aboutsummaryrefslogtreecommitdiffstats
path: root/src/js
diff options
context:
space:
mode:
authorgorhill <rhill@raymondhill.net>2015-09-30 10:17:25 -0400
committergorhill <rhill@raymondhill.net>2015-09-30 10:17:25 -0400
commit6b9848cf0d87b25178b54022c072e9f584578089 (patch)
treeb76c61db6058f6208565a4ce9eac84f0715d3c30 /src/js
parenta56dfe18582048189abaa86ae2873af1f228c0e6 (diff)
downloaduBlock-6b9848cf0d87b25178b54022c072e9f584578089.zip
uBlock-6b9848cf0d87b25178b54022c072e9f584578089.tar.gz
uBlock-6b9848cf0d87b25178b54022c072e9f584578089.tar.bz2
Exception script tag filter makes no sense: reject such filters
Diffstat (limited to 'src/js')
-rw-r--r--src/js/cosmetic-filtering.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/js/cosmetic-filtering.js b/src/js/cosmetic-filtering.js
index 1a0c873..d66c2b8 100644
--- a/src/js/cosmetic-filtering.js
+++ b/src/js/cosmetic-filtering.js
@@ -267,6 +267,7 @@ FilterParser.prototype.parse = function(s) {
// Remember original string
this.prefix = matches[1];
this.suffix = matches[3];
+ this.unhide = matches[2].charAt(1) === '@' ? 1 : 0;
// 2014-05-23:
// https://github.com/gorhill/httpswitchboard/issues/260
@@ -288,8 +289,9 @@ FilterParser.prototype.parse = function(s) {
// overhead in the content script.
// Example: focus.de##script:contains(/uabInject/)
if ( this.suffix.charAt(0) === 's' && this.reScriptContains.test(this.suffix) ) {
- // Currently supported only as non-generic selector.
- if ( this.prefix.length === 0 ) {
+ // Currently supported only as non-generic selector. Also, exception
+ // script tag filter makes no sense, ignore.
+ if ( this.prefix.length === 0 || this.unhide === 1 ) {
this.invalid = true;
return this;
}
@@ -302,7 +304,6 @@ FilterParser.prototype.parse = function(s) {
}
}
- this.unhide = matches[2].charAt(1) === '@' ? 1 : 0;
if ( this.prefix !== '' ) {
this.hostnames = this.prefix.split(/\s*,\s*/);
}