1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-07 03:12:33 +01:00

code review re last commit b446f9f8bd

This commit is contained in:
Raymond Hill 2017-12-22 11:56:27 -05:00
parent b446f9f8bd
commit 4f5f3652ed
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1260,19 +1260,17 @@ FilterContainer.prototype.compileGenericHideSelector = function(parsed, writer)
/******************************************************************************/
FilterContainer.prototype.compileGenericUnhideSelector = function(parsed, writer) {
var selector = parsed.suffix,
compiled;
var selector = parsed.suffix;
// script:contains(...)
// script:inject(...)
if ( this.reScriptSelector.test(selector) ) {
compiled = [ 6 /* js */, '!', '', selector ];
writer.push(compiled);
writer.push([ 6 /* js */, '!', '', selector ]);
return;
}
// Procedural cosmetic filters are acceptable as generic exception filters.
compiled = this.compileSelector(selector);
var compiled = this.compileSelector(selector);
if ( compiled === undefined ) { return; }
// https://github.com/chrisaljoudi/uBlock/issues/497
@ -1298,8 +1296,7 @@ FilterContainer.prototype.compileHostnameSelector = function(hostname, parsed, w
var selector = parsed.suffix,
domain = this.µburi.domainFromHostname(hostname),
hash,
compiled;
hash;
// script:contains(...)
// script:inject(...)
@ -1308,12 +1305,11 @@ FilterContainer.prototype.compileHostnameSelector = function(hostname, parsed, w
if ( unhide ) {
hash = '!' + hash;
}
compiled = [ 6 /* js */, hash, hostname, selector ];
writer.push(compiled);
writer.push([ 6 /* js */, hash, hostname, selector ]);
return;
}
compiled = this.compileSelector(selector);
var compiled = this.compileSelector(selector);
if ( compiled === undefined ) { return; }
// https://github.com/chrisaljoudi/uBlock/issues/188