Index: lib/filterClasses.js |
=================================================================== |
--- a/lib/filterClasses.js |
+++ b/lib/filterClasses.js |
@@ -699,25 +699,16 @@ RegExpFilter.fromText = function(text) |
collapse = false; |
else if (option == "SITEKEY" && typeof value != "undefined") |
sitekeys = value; |
else |
return new InvalidFilter(origText, "Unknown option " + option.toLowerCase()); |
} |
} |
- if (!blocking && (contentType == null || (contentType & RegExpFilter.typeMap.DOCUMENT)) && |
- (!options || options.indexOf("DOCUMENT") < 0) && !/^\|?[\w\-]+:/.test(text)) |
- { |
- // Exception filters shouldn't apply to pages by default unless they start with a protocol name |
- if (contentType == null) |
- contentType = RegExpFilter.prototype.contentType; |
- contentType &= ~RegExpFilter.typeMap.DOCUMENT; |
- } |
- |
try |
{ |
if (blocking) |
return new BlockingFilter(origText, text, contentType, matchCase, domains, thirdParty, sitekeys, collapse); |
else |
return new WhitelistFilter(origText, text, contentType, matchCase, domains, thirdParty, sitekeys); |
} |
catch (e) |
@@ -746,18 +737,18 @@ RegExpFilter.typeMap = { |
FONT: 32768, |
BACKGROUND: 4, // Backwards compat, same as IMAGE |
POPUP: 0x10000000, |
ELEMHIDE: 0x40000000 |
}; |
-// ELEMHIDE, POPUP option shouldn't be there by default |
-RegExpFilter.prototype.contentType &= ~(RegExpFilter.typeMap.ELEMHIDE | RegExpFilter.typeMap.POPUP); |
+// DOCUMENT, ELEMHIDE, POPUP options shouldn't be there by default |
+RegExpFilter.prototype.contentType &= ~(RegExpFilter.typeMap.DOCUMENT | RegExpFilter.typeMap.ELEMHIDE | RegExpFilter.typeMap.POPUP); |
/** |
* Class for blocking filters |
* @param {String} text see Filter() |
* @param {String} regexpSource see RegExpFilter() |
* @param {Number} contentType see RegExpFilter() |
* @param {Boolean} matchCase see RegExpFilter() |
* @param {String} domains see RegExpFilter() |