0

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.

Is there a command-line option for firefox to specify the user agent?

Grisha Levit
  • 8,194
  • 2
  • 38
  • 53

1 Answers1

1

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.

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.override", "Mozilla/5.0 AppleWebKit/…")

You can then start Firefox with the -P flag, providing the name to the specific profile.

Grisha Levit
  • 8,194
  • 2
  • 38
  • 53
  • I had more luck with `general.useragent.override` . See [this question](https://superuser.com/questions/98798/how-do-i-change-firefoxs-user-agent-via-aboutconfig) as well. Thanks! – Greg Sadetsky May 24 '22 at 17:37