1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-03 09:39:38 +02:00

Fix regex used to extract attribute name in element picker

Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/mh2ctv/
This commit is contained in:
Raymond Hill 2021-03-31 12:21:29 -04:00
parent 97619cf8f5
commit 9a94ba0a22
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -252,7 +252,7 @@ const cosmeticCandidatesFromFilterChoice = function(filterChoice) {
} }
// Remove attribute values. // Remove attribute values.
if ( (specificity & 0b0010) === 0 ) { if ( (specificity & 0b0010) === 0 ) {
const match = /^\[([^^=]+)\^?=.+\]$/.exec(filter); const match = /^\[([^^*$=]+)[\^*$]?=.+\]$/.exec(filter);
if ( match !== null ) { if ( match !== null ) {
filter = `[${match[1]}]`; filter = `[${match[1]}]`;
} }