如何在Firefox的命令行调用中指定特定的用户代理字符串? [英] How can I specify a particular user-agent string in a command-line invocation of Firefox?
问题描述
我想制作一个bash脚本,该脚本将遍历不同的用户代理选项,使用选定的用户代理打开Firefox,等待x秒,然后关闭并循环.
I would like to make a bash script that will iterate over different user agent options, open Firefox with the selected user agent, wait for x seconds, and then close, and loop.
是否有用于 firefox
的命令行选项来指定用户代理?
Is there a command-line option for firefox
to specify the user agent?
推荐答案
没有用于此特定目的的标志,但是您可以创建一组Firefox配置文件,其中每个配置文件将指定一个特定的用户代理.
There is no flag for this specific purpose, but you can create a set of Firefox profiles, where each profile will specify a particular user agent.
有一个about:config选项 general.useragent.override
,您可以在配置文件文件夹的 user.js
文件中用以下行指定:
There is an about:config option general.useragent.override
, which you can specify in the user.js
file in the profile folder with a line like:
user_pref("general.useragent.extra.firefox", "Mozilla/5.0 AppleWebKit/537.36…")
然后,您可以使用 -P
标志,为特定配置文件提供名称.
You can then start Firefox with the -P
flag, providing the name to the specific profile.
这篇关于如何在Firefox的命令行调用中指定特定的用户代理字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!