[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r16066: Fix bug 778. Update useragent to 2.0.0.16 (quiet, arma - aut (in torbutton/trunk/src: chrome/content defaults/preferences)
Author: mikeperry
Date: 2008-07-18 17:12:26 -0400 (Fri, 18 Jul 2008)
New Revision: 16066
Modified:
torbutton/trunk/src/chrome/content/torbutton.js
torbutton/trunk/src/defaults/preferences/preferences.js
Log:
Fix bug 778. Update useragent to 2.0.0.16 (quiet, arma -
autoupdates! :)
Modified: torbutton/trunk/src/chrome/content/torbutton.js
===================================================================
--- torbutton/trunk/src/chrome/content/torbutton.js 2008-07-18 19:11:30 UTC (rev 16065)
+++ torbutton/trunk/src/chrome/content/torbutton.js 2008-07-18 21:12:26 UTC (rev 16066)
@@ -779,17 +779,33 @@
if(torprefs.getBoolPref("set_uagent")) {
if(mode) {
try {
- m_tb_prefs.setCharPref("general.appname.override",
- torprefs.getCharPref("appname_override"));
+ var lang = new RegExp("LANG", "gm");
+ var appname = torprefs.getCharPref("appname_override");
+ if(torprefs.getBoolPref("spoof_english")) {
+ appname = appname.replace(lang,
+ torprefs.getCharPref("spoof_locale"));
+ } else {
+ appname = appname.replace(lang,
+ m_tb_prefs.getCharPref("general.useragent.locale"));
+ }
+ m_tb_prefs.setCharPref("general.appname.override", appname);
+
m_tb_prefs.setCharPref("general.appversion.override",
torprefs.getCharPref("appversion_override"));
m_tb_prefs.setCharPref("general.platform.override",
torprefs.getCharPref("platform_override"));
- m_tb_prefs.setCharPref("general.useragent.override",
- torprefs.getCharPref("useragent_override"));
+ var agent = torprefs.getCharPref("useragent_override");
+ if(torprefs.getBoolPref("spoof_english")) {
+ agent = agent.replace(lang,
+ torprefs.getCharPref("spoof_locale"));
+ } else {
+ agent = agent.replace(lang,
+ m_tb_prefs.getCharPref("general.useragent.locale"));
+ }
+ m_tb_prefs.setCharPref("general.useragent.override", agent);
m_tb_prefs.setCharPref("general.useragent.vendor",
torprefs.getCharPref("useragent_vendor"));
Modified: torbutton/trunk/src/defaults/preferences/preferences.js
===================================================================
--- torbutton/trunk/src/defaults/preferences/preferences.js 2008-07-18 19:11:30 UTC (rev 16065)
+++ torbutton/trunk/src/defaults/preferences/preferences.js 2008-07-18 21:12:26 UTC (rev 16066)
@@ -133,11 +133,11 @@
// User agent prefs:
pref("extensions.torbutton.appname_override","Netscape");
-pref("extensions.torbutton.appversion_override","5.0 (Windows; en-US)");
+pref("extensions.torbutton.appversion_override","5.0 (Windows; LANG)");
pref("extensions.torbutton.platform_override","Win32");
pref("extensions.torbutton.oscpu_override", "Windows NT 5.1");
-pref("extensions.torbutton.useragent_override", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14");
-pref("extensions.torbutton.productsub_override","20080404");
+pref("extensions.torbutton.useragent_override", "Mozilla/5.0 (Windows; U; Windows NT 5.1; LANG; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16");
+pref("extensions.torbutton.productsub_override","20080702");
pref("extensions.torbutton.buildID_override","0");
pref("extensions.torbutton.useragent_vendor", "");
pref("extensions.torbutton.useragent_vendorSub","");