1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-06 09:37:12 +02:00
This commit is contained in:
gorhill 2017-09-18 13:06:36 -04:00
parent 46f37dd7c2
commit 59ba5248f5
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1777,12 +1777,18 @@ FilterParser.prototype.parse = function(raw) {
// https://github.com/gorhill/uBlock/issues/1669#issuecomment-224822448
// remove pointless leading *.
// https://github.com/gorhill/uBlock/issues/3034
// - We can remove anchoring if we need to match all at the start.
if ( s.startsWith('*') ) {
s = s.replace(/^\*+([^%0-9a-z])/, '$1');
this.anchor &= ~0x6;
}
// remove pointless trailing *
// https://github.com/gorhill/uBlock/issues/3034
// - We can remove anchoring if we need to match all at the end.
if ( s.endsWith('*') ) {
s = s.replace(/([^%0-9a-z])\*+$/, '$1');
this.anchor &= ~0x1;
}
// nothing left?