mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-11 09:31:01 +01:00
code review re last commit b446f9f8bd
This commit is contained in:
parent
b446f9f8bd
commit
4f5f3652ed
1 changed files with 6 additions and 10 deletions
|
@ -1260,19 +1260,17 @@ FilterContainer.prototype.compileGenericHideSelector = function(parsed, writer)
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
FilterContainer.prototype.compileGenericUnhideSelector = function(parsed, writer) {
|
FilterContainer.prototype.compileGenericUnhideSelector = function(parsed, writer) {
|
||||||
var selector = parsed.suffix,
|
var selector = parsed.suffix;
|
||||||
compiled;
|
|
||||||
|
|
||||||
// script:contains(...)
|
// script:contains(...)
|
||||||
// script:inject(...)
|
// script:inject(...)
|
||||||
if ( this.reScriptSelector.test(selector) ) {
|
if ( this.reScriptSelector.test(selector) ) {
|
||||||
compiled = [ 6 /* js */, '!', '', selector ];
|
writer.push([ 6 /* js */, '!', '', selector ]);
|
||||||
writer.push(compiled);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Procedural cosmetic filters are acceptable as generic exception filters.
|
// Procedural cosmetic filters are acceptable as generic exception filters.
|
||||||
compiled = this.compileSelector(selector);
|
var compiled = this.compileSelector(selector);
|
||||||
if ( compiled === undefined ) { return; }
|
if ( compiled === undefined ) { return; }
|
||||||
|
|
||||||
// https://github.com/chrisaljoudi/uBlock/issues/497
|
// https://github.com/chrisaljoudi/uBlock/issues/497
|
||||||
|
@ -1298,8 +1296,7 @@ FilterContainer.prototype.compileHostnameSelector = function(hostname, parsed, w
|
||||||
|
|
||||||
var selector = parsed.suffix,
|
var selector = parsed.suffix,
|
||||||
domain = this.µburi.domainFromHostname(hostname),
|
domain = this.µburi.domainFromHostname(hostname),
|
||||||
hash,
|
hash;
|
||||||
compiled;
|
|
||||||
|
|
||||||
// script:contains(...)
|
// script:contains(...)
|
||||||
// script:inject(...)
|
// script:inject(...)
|
||||||
|
@ -1308,12 +1305,11 @@ FilterContainer.prototype.compileHostnameSelector = function(hostname, parsed, w
|
||||||
if ( unhide ) {
|
if ( unhide ) {
|
||||||
hash = '!' + hash;
|
hash = '!' + hash;
|
||||||
}
|
}
|
||||||
compiled = [ 6 /* js */, hash, hostname, selector ];
|
writer.push([ 6 /* js */, hash, hostname, selector ]);
|
||||||
writer.push(compiled);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
compiled = this.compileSelector(selector);
|
var compiled = this.compileSelector(selector);
|
||||||
if ( compiled === undefined ) { return; }
|
if ( compiled === undefined ) { return; }
|
||||||
|
|
||||||
// https://github.com/chrisaljoudi/uBlock/issues/188
|
// https://github.com/chrisaljoudi/uBlock/issues/188
|
||||||
|
|
Loading…
Reference in a new issue