[or-cvs] r13773: Truck vs bandaid, round 5. (torbutton/trunk/src/chrome/content)

mikeperry at seul.org mikeperry at seul.org
Thu Feb 28 05:19:55 UTC 2008


Author: mikeperry
Date: 2008-02-28 00:19:55 -0500 (Thu, 28 Feb 2008)
New Revision: 13773

Modified:
   torbutton/trunk/src/chrome/content/jshooks.js
Log:

Truck vs bandaid, round 5.



Modified: torbutton/trunk/src/chrome/content/jshooks.js
===================================================================
--- torbutton/trunk/src/chrome/content/jshooks.js	2008-02-28 03:43:50 UTC (rev 13772)
+++ torbutton/trunk/src/chrome/content/jshooks.js	2008-02-28 05:19:55 UTC (rev 13773)
@@ -267,11 +267,19 @@
     var Date = newDate;
   }
 
-  window.__defineGetter__("valueOf", 
-          function() { return function() { return window; } });
-  window.__proto__.__defineGetter__("valueOf", 
-          function() { return function() { return window; } });
+  // Gain access to the implict global object (which interestingly claims
+  // to be a 'Window' but is not the same class as 'window'...) and 
+  // replace its __proto__ with a copy of 'window'.
+  var tmp = new Object.prototype.toSource();
+  var wintmp = window;
+  with(window.valueOf.call()) {
+    for(var i in wintmp) {
+      tmp[i] = wintmp[i];                  
+    }
 
+    var __proto__ = tmp;
+  }
+
   // FINALLY. We got a break! WAHOO ECMA-262 compliance!
   with(window) {
       var XPCNativeWrapper = function(a) { return a; };



More information about the tor-commits mailing list