site  contact  subhomenews

User Agent Switcher 0.7.3

January 30, 2011 — BarryK
I have created a PET package of User Agent Switcher, for SeaMonkey 2.0.11+.

User Agent Switcher info page:
https://addons.mozilla.org/af/seamonkey/addon/user-agent-switcher/

I downloaded the .xpi fle from here:
http://ftp.yz.yamagata-u.ac.jp/pub/network/mozilla/addons/59/

To create the PET, I opened up 'useragentswitcher.jar' (which is a zip file), and replaced content/useragentswitcher/xml/useragents.xml with a bigger list, as the default only had user agents entries for Internet Explorer 6, 7 and 8. Which I got from here:
http://pastebin.com/f46de849f

There was a problem, first time SM is started, it opens with a User Agent Switcher web page. I edited content/useragentswitcher/upgrade.js to suppress that. I don't know any Javascript, but thought a "return 0;" would probably work:

	// Opens the upgrade page

openUpgradePage: function()
{
return 0; /*BK*/

var windowContent = window.getBrowser();

windowContent.removeEventListener("load", UserAgentSwitcherUpgrade.openUpgradePage, false);

window.setTimeout(function() { windowContent.selectedTab = windowContent.addTab("http://chrispederick.com/work/user-agent-switcher/installed/" + UserAgentSwitcherUpgrade.getVersion().replace(/\./g, "") + "/"); }, 0);
},


...which seems to have worked... at least, the upgrade/installed web page didn't open.

Download my PET (50KB):
http://distro.ibiblio.org/pub/linux/distributions/quirky/pet_packages-wary5/seamonkey_addon_user_agent_switcher-0.7.3-sm2.0.11plus.pet

...should work in SM 2.0.11 and later.

Tags: wary