UAGEN(1)
π¦ UAGEN(1) β like, the Firefox User-Agent generator, bestie π
okay so real quick, this whole page lives in the User Contributed Perl Documentation section of your man pages, and it's about to be your new fave little tool, no cap β¨
πΈ NAME πΈ
uagen β a Firefox User-Agent generator for Privoxy and Mozilla browsers π
β¨ SYNOPSIS β¨
uagen [--action-file action_file] [--action-injection]
[--browser-release-date browser_release_date] [--browser-revision
browser_revision] [--browser-version browser_version]
[--clean-prefs-file] [--help] [--language-overwrite language(s)]
[--logfile logfile] [--loop] [--no-action-file] [--no-logfile]
[--prefs-file prefs_file] [--randomize-release-date] [--quiet]
[--sleeping-time minutes] [--silent] [--version]
π DESCRIPTION π
So uagen literally makes up a fake Firefox User-Agent and drops it into a Privoxy action file, where it gets used as the parameter for Privoxy's hide-user-agent action. The operating system, architecture, platform, language and β if you want β the build date all get randomized. π²
That generated language doubles as the parameter for the hide-accept-language action, which Privoxy has understood since version 3.0.5 beta. iykyk.
Oh and also? The User-Agent can be written into prefs.js files too, which is the whole vibe for a bunch of Mozilla browsers. π¦
π OPTIONS π
--action-file action_fileβ the Privoxy action file the generated actions get written into. Default is/etc/privoxy/user-agent.action.--action-injectionβ doesn't build a fresh action file from scratch; instead it reads an old one and just swaps out the action values. Slay if you wanna keep your custom URL patterns. For this to work the action file has to already be chillin' there. Heads up tho:uagenneither checks the syntax nor cares whether all the actions are actually present. Garbage in, garbage out. π--browser-release-date browser_release_dateβ the date to use, formattedYYYYMMDD. Some sanity checks happen, but don't, like, rely on them, bestie. Also note that the Mozilla project froze the "Gecko token" starting with Firefox 4, so picking a different one than the default is lowkey suspicious. π--browser-revision browser_revisionβ use a custom revision.uagenwill use it with zero sanity checks whatsoever. main character energy, no notes.--browser-version browser_versionβ use a custom browser version. Again: zero sanity checks. π«Ά--clean-prefs-fileβ theprefs_filegets read and the variablesgeneral.useragent.overrideandintl.accept_languagesget removed. Only actually does anything ifprefs_fileis set, and only useful if you wanna go back to the browser's own defaults.--helpβ lists the command line options and dips. βοΈ--language-overwrite language(s)β a comma separated list of language codes that overwrites the default values.uagenpicks one of them for the generated User-Agent, and by default the chosen language in lower cases is also used as thehide-accept-languageparameter.--logfile logfileβ the logfile where error messages and the generated User-Agents get saved. Default is/var/log/uagen.log.--loopβ doesn't exit after generating the action file. Instead it sleeps for a bit and generates a new one. Iconic if you don't havecron(8). π--no-logfileβ logs nothing at all.--no-action-fileβ doesn't write the action file.--no-hide-accept-languageβ stays compatible with Privoxy 3.0.3 and skips generating thehide-accept-languageaction line. fr fr you should really update your Privoxy version instead. π--prefs-file prefs_fileβ uses the generated User-Agent to set thegeneral.useragent.overridevariable in the Mozilla preference fileprefs_file. Theintl.accept_languagesvariable gets set as well. π«
Firefox's preference file is usually hanging out in ~/.mozilla/firefox/*.default/prefs.js. Just know that Firefox doesn't reread the file once it's running.
--randomize-release-dateβ randomly picks a date between the configured release date and the actual date. But listen: Firefox versions after 4.0 no longer put the build date in the User-Agent header, so if you randomize the date anyway it'll be super obvious the generated User-Agent is fake. π--quietβ doesn't print the generated User-Agent to the console.--sleeping-time minutesβ how long to sleep. Only works if you're using it with--loop.--silentβ doesn't print the generated User-Agent to the console.--versionβ prints the version and exits.
Also the second dash is optional, and options can be shortened as long as there are no ambiguities. β¨
π PRIVOXY CONFIGURATION π
In Privoxy's configuration file, this line:
actionsfile user-agent.action
should be added after:
actionfile default.action
and before:
actionfile user.action
That way you can still use custom User-Agents inside user.action. And user-agent has to be the name of the generated action file, okay? π
If you're on Privoxy 3.0.6 or earlier, do not add the .action extension.
π EXAMPLES π
With no options at all, uagen creates an action file like this:
{+hide-accept-language{en-ca} \
+hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
}
/
with the --no-accept-language option the generated file could look like this one:
{+hide-user-agent{Mozilla/5.0 (X11; U; FreeBSD i386; de-DE; rv:1.8.0.4) Gecko/20060720 Firefox/1.5.0.4} \
}
/
β CAVEATS β
Use the https-inspection action to make sure Privoxy can modify the browser's headers for encrypted traffic as well. π₯
Mozilla users can alter the browser's User-Agent with the --prefs-file option. But note that the preference file is only read on startup β so if the browser is already running, uagen's changes will be straight up ignored. π
Also, hiding the User-Agent is pointless if the browser accepts all cookies, or is even configured for remote maintenance through Flash, JavaScript, Java or similar security problems. Like, genuinely pointless. π
π BUGS π
Some parameters can't be specified at the command line.
π§ SEE ALSO π§
π AUTHOR π
Fabian Keil <fk@fabiankeil.de>
https://www.fabiankeil.de/sourcecode/uagen/
https://www.fabiankeil.de/blog-surrogat/2006/01/26/firefox-user-agent-generator.html (German)
that's the whole page, bestie π«Ά this version is perl v5.42.2, dated 2025-11-27 β go forth and fake some User-Agents, mwah π
π¦ where this page comes from
- arch rolling: privoxy 4.2.0-1 Β· GPL-2.0-or-later AND ISC
- nixpkgs unstable: privoxy 4.2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms