[or-cvs] r10756: Fix a thrown exception from intl.* pref clearing. Fix Date h (torbutton/trunk/src/chrome/content)
mikeperry at seul.org
mikeperry at seul.org
Sat Jul 7 00:22:47 UTC 2007
Author: mikeperry
Date: 2007-07-06 20:22:47 -0400 (Fri, 06 Jul 2007)
New Revision: 10756
Modified:
torbutton/trunk/src/chrome/content/jshooks.js
torbutton/trunk/src/chrome/content/torbutton.js
Log:
Fix a thrown exception from intl.* pref clearing. Fix Date
hooking bug: getUTCYear is not a method.
Modified: torbutton/trunk/src/chrome/content/jshooks.js
===================================================================
--- torbutton/trunk/src/chrome/content/jshooks.js 2007-07-07 00:20:52 UTC (rev 10755)
+++ torbutton/trunk/src/chrome/content/jshooks.js 2007-07-07 00:22:47 UTC (rev 10756)
@@ -12,7 +12,7 @@
/* Hrmm.. Is it possible this breaks plugin install or other weird shit
for non-windows OS's? */
- if(__tb_set_uagent) {
+ if(window.__tb_set_uagent) {
var tmp_oscpu = window.__tb_oscpu;
var tmp_platform = window.__tb_platform;
var tmp_productSub = window.__tb_productSub;
@@ -82,7 +82,7 @@
Date.prototype.valueOf=Date.prototype.getTime = /* UTC already */
function(){return d.getTime();}
Date.prototype.getFullYear=function(){return d.getUTCFullYear();}
- Date.prototype.getYear=function() {return d.getUTCYear();}
+ Date.prototype.getYear=function() {return d.getYear();}
Date.prototype.getMonth=function(){return d.getUTCMonth();}
Date.prototype.getDate=function() {return d.getUTCDate();}
Date.prototype.getDay=function() {return d.getUTCDay();}
@@ -95,7 +95,7 @@
Date.prototype.setTime =
function(x) {return d.setTime(x);}
Date.prototype.setFullYear=function(x){return d.setUTCFullYear(x);}
- Date.prototype.setYear=function(x){return d.setUTCYear(x);}
+ Date.prototype.setYear=function(x){return d.setYear(x);}
Date.prototype.setMonth=function(x){return d.setUTCMonth(x);}
Date.prototype.setDate=function(x){return d.setUTCDate(x);}
Date.prototype.setDay=function(x){return d.setUTCDay(x);}
@@ -106,7 +106,6 @@
function(x) {return d.setUTCMilliseconds(x);}
Date.prototype.getUTCFullYear=function(){return d.getUTCFullYear();}
- Date.prototype.getUTCYear=function() {return d.getUTCYear();}
Date.prototype.getUTCMonth=function(){return d.getUTCMonth();}
Date.prototype.getUTCDate=function() {return d.getUTCDate();}
Date.prototype.getUTCDay=function() {return d.getUTCDay();}
@@ -117,7 +116,6 @@
function(){return d.getUTCMilliseconds();}
Date.prototype.setUTCFullYear=function(x){return d.setUTCFullYear(x);}
- Date.prototype.setUTCYear=function(x){return d.setUTCYear(x);}
Date.prototype.setUTCMonth=function(x){return d.setUTCMonth(x);}
Date.prototype.setUTCDate=function(x){return d.setUTCDate(x);}
Date.prototype.setUTCDay=function(x){return d.setUTCDay(x);}
Modified: torbutton/trunk/src/chrome/content/torbutton.js
===================================================================
--- torbutton/trunk/src/chrome/content/torbutton.js 2007-07-07 00:20:52 UTC (rev 10755)
+++ torbutton/trunk/src/chrome/content/torbutton.js 2007-07-07 00:22:47 UTC (rev 10756)
@@ -425,6 +425,8 @@
torbutton_update_toolbutton(mode);
torbutton_update_statusbar(mode);
+ torbutton_log(2, 'Changed: '+changed);
+
// this function is called every time there is a new window! Alot of this
// stuff expects to be called on toggle only.. like the cookie jars and
// history/cookie clearing
@@ -484,8 +486,13 @@
m_tb_prefs.setCharPref("intl.accept_languages",
torprefs.getCharPref("spoof_language"));
} else {
- m_tb_prefs.clearUserPref("intl.accept_charsets");
- m_tb_prefs.clearUserPref("intl.accept_languages");
+ try {
+ m_tb_prefs.clearUserPref("intl.accept_charsets");
+ m_tb_prefs.clearUserPref("intl.accept_languages");
+ } catch (e) {
+ // Can happen if english browser.
+ torbutton_log(1, "Browser already english");
+ }
}
if(torprefs.getIntPref("shutdown_method") == 1) {
More information about the tor-commits
mailing list