I have to use a particular web site for work, but this web site checks to see whether I'm using Internet Explorer and, if not, won't allow me to log in. I can switch my User-Agent header using the User Agent Switcher Firefox plugin and the web site works fine, but I really don't want to switch the header every time I go to the site and also don't want my User-Agent header to perpetually say I'm using IE.
I'm on Linux, so actually switching to IE unfortunately isn't an option.
Is there any way to define a particular User-Agent for a particular web site in either Firefox or Chrome?
07 Answers
The extension User-Agent Switcher for Chrome has a Permanent Spoof list, where you can set specific user agents for certain domains.
Configuration
Add the extension to Chrome.
Open
chrome-extension://djflhoibgkdhkhhcedjiklpkjnoahfmg/options.html.Click
Permanent Spoof list.Enter the domain of the particualr website, select the desired user agent and click
Add.
Until Firefox 25, one could set general.useragent.override.[domain] to a custom UA string. Unfortunately, this feature was removed in Firefox 25.
Now, to get per-site UA string, one could install UAControl plus User-Agent JS Fixer. The first add-on modifies the User-Agent request header per site, but not the navigator.userAgent string that is often used for UA-sniffing. The second add-on complements the first add-on by overriding navigator.userAgent.
Since I already had Greasemonkey installed, and the site I'm targetting only uses client-side User-Agent sniffing, I decided to write a small user script to change navigator.userAgent for this particular site:
// ==UserScript==
// @name Change navigator.userAgent
// @namespace Rob W
// @description Changes navigator.userAgent to IE on IEGallery.com
// @match
// @run-at document-start
// @grant none
// @version 1
// ==/UserScript==
Object.defineProperty(navigator, 'userAgent', { value: 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)'
});Works like a charm in Firefox 26.0.
2For Firefox there are the extensions UAControl and ua-site-switch, which allow setting the User-Agent header on a per-site basis. Pick one of them and, as Rob W pointed out, you'll need to install User-Agent JS Fixer too.
4There are many extensions you can use which can work by auto detecting the IE setting for the website on FF.
The updated, fully supported IE Tab. Embed IE in a Firefox tab.
IE Tab Features: FF 4+ support, IE 7-9 compatibility modes, old IE Tab settings import. IE Tab supports ICBC and alipay
The Original IE-Tab (Works also for IE8, IE9)
An enhanced version of IE Tab with Adblock Plus in IE supported. It also allows you import settings from IE Tab and synchronize cookies between IE and Firefox.
Only IE-Tab to support FF4 and beyond
1You can use an addon like IE-tab, which will actually use IE DLLs from within Firefox, so the page will not only think you are using IE but it will render the same. It can be set to automatically apply when you visit specific pages, so that you get Firefox rendering on everything except the sites that require IE.
1Here's what I did in FireFox:
Used UserAgentSwitcher Addon to spoof myself as an iphone. Visited site I always want to load the mobile version of, and it automatically loaded the mobile version.
Made a bookmark to the site's mobile page.
Set UAcontrol Addon to use iphone useragent on the site.
Turned off UserAgentSwitcher.
When I launch the site from the regular bookmark it uses the regular website. And when I launch the site from the mobile version bookmark, it uses the mobile version.
Thus... UserAccountSwitcher functionality localized to one site rather than globally.
3I needed to switch user agent to fix low resolution images in Firefox on Android. I found a lot of dead links to agent switchers, but this one worked in Firefox - even on Android: User Agent Switcher: