mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-05 18:32:30 +01:00
Do not implicitly strict-block when pattern contains no token char
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1147
This commit is contained in:
parent
90868e873c
commit
0549bfaf00
@ -243,9 +243,14 @@ const onBeforeRootFrameRequest = function(fctxt) {
|
||||
|
||||
// https://github.com/gorhill/uBlock/issues/3208
|
||||
// Mind case insensitivity.
|
||||
|
||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/1147
|
||||
// Do not strict-block if the filter pattern does not contain at least one
|
||||
// token character.
|
||||
const toBlockDocResult = function(url, hostname, logData) {
|
||||
if ( typeof logData.regex !== 'string' ) { return false; }
|
||||
if ( typeof logData.raw === 'string' && /\w/.test(logData.raw) === false ) {
|
||||
return false;
|
||||
}
|
||||
const re = new RegExp(logData.regex, 'i');
|
||||
const match = re.exec(url.toLowerCase());
|
||||
if ( match === null ) { return false; }
|
||||
|
Loading…
Reference in New Issue
Block a user