1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-06 09:37:12 +02:00

fix #3379 (regression from a9f68fe02f)

This commit is contained in:
Raymond Hill 2017-12-29 08:05:50 -05:00
parent fd1410ac9f
commit a8d79feecd
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -580,8 +580,9 @@
if ( (rpos - lpos) > 3 ) { return false; }
// Extract the selector.
var suffix = parsed.suffix = raw.slice(rpos + 1).trim();
var suffix = raw.slice(rpos + 1).trim();
if ( suffix.length === 0 ) { return false; }
parsed.suffix = suffix;
// https://github.com/gorhill/uBlock/issues/952
// Find out whether we are dealing with an Adguard-specific cosmetic
@ -602,6 +603,7 @@
if ( cCode === 0x24 /* '$' */ ) {
suffix = translateAdguardCSSInjectionFilter(suffix);
if ( suffix === '' ) { return true; }
parsed.suffix = suffix;
}
}
@ -628,15 +630,13 @@
return true;
}
// Script tag filtering: courtesy-conversion to HTML filtering.
if ( parsed.suffix.startsWith('script:contains') ) {
if ( suffix.startsWith('script:contains') ) {
console.info(
'uBO: ##script:contains(...) is deprecated, ' +
'converting to ##^script:has-text(...)'
);
suffix = parsed.suffix = suffix.replace(
/^script:contains/,
'^script:has-text'
);
suffix = suffix.replace(/^script:contains/, '^script:has-text');
parsed.suffix = suffix;
}
}