mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-11 17:41:03 +01:00
This commit is contained in:
parent
2d1f15eac6
commit
5eff4a027a
1 changed files with 4 additions and 0 deletions
|
@ -117,6 +117,7 @@ const fromCosmeticFilter = function(details) {
|
||||||
const prefix = match[0];
|
const prefix = match[0];
|
||||||
const exception = prefix.charAt(1) === '@';
|
const exception = prefix.charAt(1) === '@';
|
||||||
const selector = details.rawFilter.slice(prefix.length);
|
const selector = details.rawFilter.slice(prefix.length);
|
||||||
|
const isHtmlFilter = prefix.endsWith('^');
|
||||||
|
|
||||||
// The longer the needle, the lower the number of false positives.
|
// The longer the needle, the lower the number of false positives.
|
||||||
const needle = selector.match(/\w+/g).reduce(function(a, b) {
|
const needle = selector.match(/\w+/g).reduce(function(a, b) {
|
||||||
|
@ -182,6 +183,9 @@ const fromCosmeticFilter = function(details) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not confuse cosmetic filters with HTML ones.
|
||||||
|
if ( (fargs[0] === 64) !== isHtmlFilter ) { continue; }
|
||||||
|
|
||||||
switch ( fargs[0] ) {
|
switch ( fargs[0] ) {
|
||||||
// Lowly generic cosmetic filters
|
// Lowly generic cosmetic filters
|
||||||
case 0: // simple id-based
|
case 0: // simple id-based
|
||||||
|
|
Loading…
Reference in a new issue