[Pkg-mozext-commits] [greasemonkey] 02/43: [WIP] Pass URL to sandbox

David Prévot taffit at moszumanska.debian.org
Sun Feb 22 21:56:09 UTC 2015


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

taffit pushed a commit to branch master
in repository greasemonkey.

commit 01ca5ccabf2f400df4fbb27742469c5efc98c18c
Author: Ventero <ventero at ventero.de>
Date:   Sat Sep 27 05:13:59 2014 +0200

    [WIP] Pass URL to sandbox
---
 content/framescript.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/content/framescript.js b/content/framescript.js
index 6d7dd0a..6033172 100644
--- a/content/framescript.js
+++ b/content/framescript.js
@@ -12,8 +12,9 @@ Cu.import('resource://greasemonkey/util.js');
 var gStripUserPassRegexp = new RegExp('(://)([^:/]+)(:[^@/]+)?@');
 var gScriptRunners = {};
 
-function ScriptRunner(aWindow) {
+function ScriptRunner(aWindow, aUrl) {
   this.window = aWindow;
+  this.url = aUrl;
 }
 
 ScriptRunner.prototype.injectScripts = function(aScripts) {
@@ -26,7 +27,7 @@ ScriptRunner.prototype.injectScripts = function(aScripts) {
   }
 
   for (var i = 0, script = null; script = aScripts[i]; i++) {
-    var sandbox = createSandbox(script, this.window);
+    var sandbox = createSandbox(script, this.window, this.url);
     runScriptInSandbox(script, sandbox);
   }
 }
@@ -86,7 +87,7 @@ var observer = {
       // Update the window in case it changed, see the comment in observe().
       gScriptRunners[windowId].window = aWrappedContentWin;
     } else {
-      gScriptRunners[windowId] = new ScriptRunner(aWrappedContentWin);
+      gScriptRunners[windowId] = new ScriptRunner(aWrappedContentWin, url);
     }
 
     var response = sendSyncMessage('greasemonkey:scripts-for-url', {

-- 
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