Commit 1499949c authored by Tails developers's avatar Tails developers

Fix getTorBrowserUserAgent script.

With TBB, the prefs we look for are hidden inside an archive.
parent 867306eb
use warnings;
use strict;
use 5.10.0;
use Fatal qw( open close );
sub getTorBrowserUserAgent {
my $file = shift;
my $ua;
open (my $in, "<", $file);
while (my $line = <$in>) {
chomp $line;
if (($ua) = ($line =~ m/^pref[(]"general[.]useragent[.]override", "(.*)"[)];$/)) {
close $in;
return $ua;
my $ua = getTorBrowserUserAgent('/etc/iceweasel/pref/000-tor-browser.js');
if (defined $ua && $ua) {
say $ua;
else {
die "Unparseable file."
unzip -q -p /usr/local/lib/tor-browser/Browser/browser/omni.ja \
defaults/preferences/000-tor-browser.js | \
sed -n 's@^pref("general\.useragent\.override", "\(.*\)");$@\1@p'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment