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

Fix regression in reverse lookup of cosmetic filters

Related commit:
- d1715fb19f
This commit is contained in:
Raymond Hill 2020-07-04 10:11:53 -04:00
parent 5e949981e0
commit 000886002d
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -126,7 +126,7 @@ const fromCosmeticFilter = function(details) {
// The longer the needle, the lower the number of false positives. // The longer the needle, the lower the number of false positives.
// https://github.com/uBlockOrigin/uBlock-issues/issues/1139 // https://github.com/uBlockOrigin/uBlock-issues/issues/1139
// Mind that there is no guarantee a selector has `\w` characters. // Mind that there is no guarantee a selector has `\w` characters.
const needle = selector.match(/\w+|^.*$/g).reduce(function(a, b) { const needle = selector.match(/\w+|\*/g).reduce(function(a, b) {
return a.length > b.length ? a : b; return a.length > b.length ? a : b;
}); });