Raymond Hill 2019-05-20 18:29:28 -04:00
parent 2d1f15eac6
commit 5eff4a027a
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 4 additions and 0 deletions

View File

@ -117,6 +117,7 @@ const fromCosmeticFilter = function(details) {
const prefix = match[0];
const exception = prefix.charAt(1) === '@';
const selector = details.rawFilter.slice(prefix.length);
const isHtmlFilter = prefix.endsWith('^');
// The longer the needle, the lower the number of false positives.
const needle = selector.match(/\w+/g).reduce(function(a, b) {
@ -182,6 +183,9 @@ const fromCosmeticFilter = function(details) {
continue;
}
// Do not confuse cosmetic filters with HTML ones.
if ( (fargs[0] === 64) !== isHtmlFilter ) { continue; }
switch ( fargs[0] ) {
// Lowly generic cosmetic filters
case 0: // simple id-based