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

update reverse lookup code to deal with #711

This commit is contained in:
gorhill 2015-09-13 14:59:33 -04:00
parent f5bb9cec69
commit ce12fdba01

View File

@ -103,11 +103,10 @@ var fromCosmeticFilter = function(details) {
var matches = rePlainSelector.exec(filter);
if ( matches ) {
if ( matches[0] === filter ) { // simple CSS selector
reStr = rescape('c\vlg\v');
reStr = rescape('c\vlg\v' + filter);
} else { // complex CSS selector
reStr = rescape('c\vlg+\v');
reStr = rescape('c\vlg+\v' + matches[0] + '\v' + filter);
}
reStr += '\\w+' + rescape('\v' + filter);
} else if ( reHighLow.test(filter) ) { // [alt] or [title]
reStr = rescape('c\vhlg0\v' + filter);
} else if ( reHighMedium.test(filter) ) { // [href^="..."]