0
votes

Extension Link: https://www.dephormation.org.uk/?page=81

This plugin is great. It has one problem though, on pages that use AJAX to make http requests, it switches the user agent for each request and confuses many ajax applications.

What I want to do is figure out where the preferences for this plugin are saved. Particularly, where all the User-Agent Strings that are currently being used are located. I would like to do this so that I could edit these settings outside of firefox before I open the browser so as to "hot swap" one user agent string for each browsing session at a time. I have looked through all kinds of .sqlite databases in my firefox profile but still haven't found the information.

I am using Watir-Webdriver with ruby to application test.

2
In case it helps you, you can disable user agent switching by right-clicking on the toolbar/navbar item for this plugin and unchecking the "Rotate User Agent" box under the User Agents tab... this is also how you choose the user agents you'll use. - 2rs2ts

2 Answers

1
votes

You don't need an add-on for that - changing general.useragent.override preference (create it if not present yet) is enough to set a different user agent string. In Firefox you can do it under about:config, when Firefox isn't running you can add this preference to the file prefs.js in the Firefox profile.

1
votes

As Mr Palant said... simply changing general.useragent.override would achieve what you want.

Type about:config in the address bar, accept the warning, and filter on useragent and you'll see the setting.

I gather (but haven't tested) this preference may not affect the user agent presented to client side Javascript code. So if your Ajax code references navigator.useragent you might find the real user agent is returned despite your override setting.

Pete (author of SecretAgent). www.secretagent.org.uk

PS See also https://developer.mozilla.org/en/Document_Object_Model_%28DOM%29/window.navigator.userAgent