X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=tools%2Fuagen.pl;h=235a51571b327dcbe154ef50017927de25866573;hb=a18f401e2bd560e00cece03d4a56d9e2a6f06ed5;hp=4ab9444aac421af349a7af3b530ac1748511043f;hpb=74da8556618cbd7e499e46ecd598aec0ae9feba4;p=privoxy.git diff --git a/tools/uagen.pl b/tools/uagen.pl index 4ab9444a..235a5157 100755 --- a/tools/uagen.pl +++ b/tools/uagen.pl @@ -3,7 +3,7 @@ ############################################################################################## # uagen (http://www.fabiankeil.de/sourcecode/uagen/) # -# $Id: uagen.pl,v 1.19 2012/03/18 13:46:54 fabiankeil Exp $ +# $Id: uagen.pl,v 1.23 2012/10/21 13:05:09 fabiankeil Exp $ # # Generates a pseudo-random Firefox user agent and writes it into a Privoxy action file # and optionally into a Mozilla prefs file. For documentation see 'perldoc uagen(.pl)'. @@ -60,8 +60,8 @@ use constant { # are too lazy to check, but want to change them anyway, take the values you # see in the "Help/About Mozilla Firefox" menu. - BROWSER_VERSION => "10.0.3", - BROWSER_REVISION => '10.0.3', + BROWSER_VERSION => "16.0", + BROWSER_REVISION => '16.0', BROWSER_RELEASE_DATE => '20100101', }; @@ -234,7 +234,7 @@ sub log_to_file($) { return if $no_logging; - open(my $log_fd, ">>" . $logfile) || die "Writing " . $logfile . " failed"; + open(my $log_fd, ">>", $logfile) || die "Writing " . $logfile . " failed"; printf $log_fd UAGEN_VERSION . " ($logtime) $message\n"; close($log_fd); } @@ -276,7 +276,7 @@ sub write_action_file() { $action_file_content .= sprintf " +hide-user-agent{%s} \\\n}\n/\n", $user_agent; } - open(my $actionfile_fd, ">" . $action_file) + open(my $actionfile_fd, ">", $action_file) or log_error "Writing action file $action_file failed!"; print $actionfile_fd $action_file_content; close($actionfile_fd); @@ -294,7 +294,7 @@ sub write_prefs_file() { my $prefs_file_content = ''; my $prefsfile_fd; - if (open($prefsfile_fd, $mozilla_prefs_file)) { + if (open($prefsfile_fd, "<", $mozilla_prefs_file)) { while (<$prefsfile_fd>) { s@user_pref\(\"general.useragent.override\",.*\);\n?@@; @@ -311,7 +311,7 @@ sub write_prefs_file() { sprintf("user_pref(\"intl.accept_languages\", \"%s\");\n", $accept_language) unless $clean_prefs; - open($prefsfile_fd, ">" . $mozilla_prefs_file) + open($prefsfile_fd, ">", $mozilla_prefs_file) or log_error "Writing prefs file $mozilla_prefs_file failed!"; print $prefsfile_fd $prefs_file_content; close($prefsfile_fd);