.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "UAGEN 1" .TH UAGEN 1 2025-11-27 "perl v5.42.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME uagen \- A Firefox User\-Agent generator for Privoxy and Mozilla browsers .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBuagen\fR [\fB\-\-action\-file\fR \fIaction_file\fR] [\fB\-\-action\-injection\fR] [\fB\-\-browser\-release\-date\fR \fIbrowser_release_date\fR] [\fB\-\-browser\-revision\fR \fIbrowser_revision\fR] [\fB\-\-browser\-version\fR \fIbrowser_version\fR] [\fB\-\-clean\-prefs\-file\fR] [\fB\-\-help\fR] [\fB\-\-language\-overwrite\fR \fIlanguage(s)\fR] [\fB\-\-logfile\fR \fIlogfile\fR] [\fB\-\-loop\fR] [\fB\-\-no\-action\-file\fR] [\fB\-\-no\-logfile\fR] [\fB\-\-prefs\-file\fR \fIprefs_file\fR] [\fB\-\-randomize\-release\-date\fR] [\fB\-\-quiet\fR] [\fB\-\-sleeping\-time\fR \fIminutes\fR] [\fB\-\-silent\fR] [\fB\-\-version\fR] .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBuagen\fR generates a fake Firefox User\-Agent and writes it into a Privoxy action file as parameter for Privoxy\*(Aqs \fBhide\-user\-agent\fR action. Operating system, architecture, platform, language and, optionally, the build date are randomized. .PP The generated language is also used as parameter for the \&\fBhide\-accept\-language\fR action which is understood by Privoxy since version 3.0.5 beta. .PP Additionally the User\-Agent can be written into prefs.js files which are used by many Mozilla browsers. .SH OPTIONS .IX Header "OPTIONS" \&\fB\-\-action\-file\fR \fIaction_file\fR Privoxy action file to write the generated actions into. Default is /etc/privoxy/user\-agent.action. .PP \&\fB\-\-action\-injection\fR Don\*(Aqt generate a new action file from scratch, but read an old one and just replace the action values. Useful to keep custom URL patterns. For this to work, the action file has to be already present. \fBuagen\fR neither checks the syntax nor cares if all actions are present. Garbage in, garbage out. .PP \&\fB\-\-browser\-release\-date\fR \fIbrowser_release_date\fR Date to use. The format is YYYYMMDD. Some sanity checks are done, but you shouldn\*(Aqt rely on them. Note that the Mozilla project has frozen the "Gecko token" starting with Firefox 4 so using a different one than the default is somewhat suspicious. .PP \&\fB\-\-browser\-revision\fR \fIbrowser_revision\fR Use a custom revision. \&\fBuagen\fR will use it without any sanity checks. .PP \&\fB\-\-browser\-version\fR \fIbrowser_version\fR Use a custom browser version. \&\fBuagen\fR will use it without any sanity checks. .PP \&\fB\-\-clean\-prefs\-file\fR The \fIprefs_file\fR is read and the variables \&\fBgeneral.useragent.override\fR and \fBintl.accept_languages\fR are removed. Only effective if \fIprefs_file\fR is set, and only useful if you want to use the browser\*(Aqs defaults again. .PP \&\fB\-\-help\fR List command line options and exit. .PP \&\fB\-\-language\-overwrite\fR \fIlanguage(s)\fR Comma separated list of language codes to overwrite the default values. \fBuagen\fR chooses one of them for the generated User\-Agent, by default the chosen language in lower cases is also used as \&\fBhide\-accept\-language\fR parameter. .PP \&\fB\-\-logfile\fR \fIlogfile\fR Logfile to save error messages and the generated User\-Agents. Default is /var/log/uagen.log. .PP \&\fB\-\-loop\fR Don\*(Aqt exit after the generation of the action file. Sleep for a while and generate a new one instead. Useful if you don\*(Aqt have \fBcron\fR\|(8). .PP \&\fB\-\-no\-logfile\fR Don\*(Aqt log anything. .PP \&\fB\-\-no\-action\-file\fR Don\*(Aqt write the action file. .PP \&\fB\-\-no\-hide\-accept\-language\fR Stay compatible with Privoxy 3.0.3 and don\*(Aqt generate the \fBhide\-accept\-language\fR action line. You should really update your Privoxy version instead. .PP \&\fB\-\-prefs\-file\fR \fIprefs_file\fR Use the generated User\-Agent to set the \&\fBgeneral.useragent.override\fR variable in the Mozilla preference file \&\fIprefs_file\fR, The \fBintl.accept_languages\fR variable will be set as well. .PP Firefox\*(Aqs preference file is usually located in ~/.mozilla/firefox/*.default/prefs.js. Note that Firefox doesn\*(Aqt reread the file once it is running. .PP \&\fB\-\-randomize\-release\-date\fR Randomly pick a date between the configured release date and the actual date. Note that Firefox versions after 4.0 no longer provide the build date in the User\-Agent header, so if you randomize the date anyway, it will be obvious that the generated User\-Agent is fake. .PP \&\fB\-\-quiet\fR Don\*(Aqt print the generated User\-Agent to the console. .PP \&\fB\-\-sleeping\-time\fR \fIminutes\fR Time to sleep. Only effective if used with \fB\-\-loop\fR. .PP \&\fB\-\-silent\fR Don\*(Aqt print the generated User\-Agent to the console. .PP \&\fB\-\-version\fR Print version and exit. .PP The second dash is optional, options can be shortened, as long as there are no ambiguities. .SH "PRIVOXY CONFIGURATION" .IX Header "PRIVOXY CONFIGURATION" In Privoxy\*(Aqs configuration file the line: .PP .Vb 1 \& actionsfile user\-agent.action .Ve .PP should be added after: .PP .Vb 1 \& actionfile default.action .Ve .PP and before: .PP .Vb 1 \& actionfile user.action .Ve .PP This way the user can still use custom User\-Agents in \fIuser.action\fR. \fIuser\-agent\fR has to be the name of the generated action file. .PP If you are using Privoxy 3.0.6 or earlier, don\*(Aqt add the ".action" extension. .SH EXAMPLES .IX Header "EXAMPLES" Without any options, \fBuagen\fR creates an action file like: .PP .Vb 4 \& {+hide\-accept\-language{en\-ca} \e \& +hide\-user\-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en\-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \e \& } \& / .Ve .PP with the \-\-no\-accept\-language option the generated file could look like this one: .PP .Vb 3 \& {+hide\-user\-agent{Mozilla/5.0 (X11; U; FreeBSD i386; de\-DE; rv:1.8.0.4) Gecko/20060720 Firefox/1.5.0.4} \e \& } \& / .Ve .SH CAVEATS .IX Header "CAVEATS" Use the https\-inspection action to make sure Privoxy can modify the browser\*(Aqs headers for encrypted traffic as well. .PP Mozilla users can alter the browser\*(Aqs User\-Agent with the \&\fB\-\-prefs\-file\fR option. But note that the preference file is only read on startup. If the browser is already running, \fBuagen\*(Aqs\fR changes will be ignored. .PP Hiding the User\-Agent is pointless if the browser accepts all cookies or even is configured for remote maintenance through Flash, JavaScript, Java or similar security problems. .SH BUGS .IX Header "BUGS" Some parameters can\*(Aqt be specified at the command line. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBprivoxy\fR\|(8) .SH AUTHOR .IX Header "AUTHOR" Fabian Keil .PP https://www.fabiankeil.de/sourcecode/uagen/ .PP https://www.fabiankeil.de/blog\-surrogat/2006/01/26/firefox\-user\-agent\-generator.html (German)