[Pkg-mozext-commits] [greasemonkey] 06/15: Propagate unsafeWindow Xray waivers into the sandbox.

David Prévot taffit at moszumanska.debian.org
Sat Aug 2 12:51:55 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository greasemonkey.

commit 4dd733ccb1abb7c1232950299c8f65ca72bf8875
Author: Anthony Lieuallen <arantius at gmail.com>
Date:   Thu Jul 31 10:57:45 2014 -0400

    Propagate unsafeWindow Xray waivers into the sandbox.
    
    Context: http://bugzil.la/742444
    
    Fixes #1975
---
 components/greasemonkey.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/components/greasemonkey.js b/components/greasemonkey.js
index 8429bdc..45ffe0a 100644
--- a/components/greasemonkey.js
+++ b/components/greasemonkey.js
@@ -102,8 +102,12 @@ function createSandbox(
         'sandboxPrototype': aContentWin,
         'wantXrays': true,
       });
-  sandbox.unsafeWindow = aContentWin.wrappedJSObject;
   if (aFirebugConsole) sandbox.console = aFirebugConsole;
+  // Note that because waivers aren't propagated between origins, we need the
+  // unsafeWindow getter to live in the sandbox.  See http://bugzil.la/1043958
+  var unsafeWindowGetter = new sandbox.Function(
+      'return window.wrappedJSObject || window;');
+  Object.defineProperty(sandbox, 'unsafeWindow', {get: unsafeWindowGetter});
 
   // Functions for interaction with unsafeWindow; see: http://goo.gl/C8Au16
   sandbox.createObjectIn = Cu.createObjectIn;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git



More information about the Pkg-mozext-commits mailing list