[Pkg-mozext-commits] [greasemonkey] 17/43: Prevent frame script injection into chrome frames.
David Prévot
taffit at moszumanska.debian.org
Sun Feb 22 21:56:10 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 24cc885e03524cab9d1b57fb379b376cfe745480
Author: Ventero <ventero at ventero.de>
Date: Tue Nov 4 21:35:30 2014 +0100
Prevent frame script injection into chrome frames.
---
content/framescript.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/content/framescript.js b/content/framescript.js
index 960e5a1..de956fe 100644
--- a/content/framescript.js
+++ b/content/framescript.js
@@ -5,11 +5,15 @@ var Cc = Components.classes;
var Ci = Components.interfaces;
var Cu = Components.utils;
-
+(function() {
// \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ //
// For every frame/process, make sure the content observer is running.
+var rti = docShell.QueryInterface(Ci.nsIDocShellTreeItem).rootTreeItem;
+if (rti.itemType != Ci.nsIDocShellTreeItem.typeContent)
+ return;
+
Cu.import('resource://greasemonkey/contentObserver.js');
// \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ //
@@ -21,3 +25,4 @@ addMessageListener("greasemonkey:inject-script",
contentObserver.runDelayedScript.bind(contentObserver));
addMessageListener("greasemonkey:menu-command-clicked",
contentObserver.runMenuCommand.bind(contentObserver));
+})();
--
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