From 84d4a9e1e60b41bf8053563e0dde4741bd5fec08 Mon Sep 17 00:00:00 2001 From: Anthony Lieuallen Date: Wed, 20 Apr 2011 11:50:02 -0400 Subject: [PATCH] Do not run scripts in about:blank (Unless _specifically_ requested.) Fixes #1298 --- content/script.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/content/script.js b/content/script.js index 26dc3b0d5..dc12f4c1e 100644 --- a/content/script.js +++ b/content/script.js @@ -31,8 +31,15 @@ function Script(configNode) { Script.prototype = { matchesURL: function(url) { - function test(page) { - return convert2RegExp(page).test(url); + function test(glob) { + // Do not run in about:blank unless _specifically_ requested. See #1298 + if (-1 !== url.indexOf('about:blank') + && -1 == glob.indexOf('about:blank') + ) { + return false; + } + + return convert2RegExp(glob).test(url); } return GM_isGreasemonkeyable(url)