[Pkg-mozext-commits] [greasemonkey] 17/25: Make check for about:blank URIs more exact.

David Prévot taffit at moszumanska.debian.org
Wed Sep 17 21:14:02 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 79c97e527f333da186be2bee34b43e937bfa52fe
Author: Ventero <ventero at ventero.de>
Date:   Mon Aug 25 21:27:20 2014 +0200

    Make check for about:blank URIs more exact.
---
 modules/script.js | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/script.js b/modules/script.js
index 3225981..58ecb8b 100644
--- a/modules/script.js
+++ b/modules/script.js
@@ -25,6 +25,7 @@ AddonManager.getAddonByID(GM_GUID, function(addon) {
   gGreasemonkeyVersion = '' + addon.version;
 });
 
+var gAboutBlankRegexp = /^about:blank/;
 
 function Script(configNode) {
   this._observers = [];
@@ -76,9 +77,7 @@ Script.prototype.matchesURL = function(url) {
 
   function testClude(glob) {
     // Do not run in about:blank unless _specifically_ requested.  See #1298
-    if (-1 !== url.indexOf('about:blank')
-        && -1 == glob.indexOf('about:blank')
-    ) {
+    if (gAboutBlankRegexp.test(url) && !gAboutBlankRegexp.test(glob)) {
       return false;
     }
 

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