mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Improve urlskip implementation
Support multiple instances of regex-based steps. Related issue: https://github.com/uBlockOrigin/uBlock-issues/issues/3914
This commit is contained in:
parent
74b838cc03
commit
41ced43f03
1 changed files with 2 additions and 5 deletions
|
|
@ -72,7 +72,7 @@
|
|||
*
|
||||
* */
|
||||
|
||||
export function urlSkip(url, blocked, steps, directive = {}) {
|
||||
export function urlSkip(url, blocked, steps) {
|
||||
try {
|
||||
let redirectBlocked = false;
|
||||
let urlout = url;
|
||||
|
|
@ -132,10 +132,7 @@ export function urlSkip(url, blocked, steps, directive = {}) {
|
|||
}
|
||||
// Regex extraction from first capture group
|
||||
if ( c0 === 0x2F ) { // /
|
||||
const re = directive.cache ?? new RegExp(step.slice(1, -1));
|
||||
if ( directive.cache === null ) {
|
||||
directive.cache = re;
|
||||
}
|
||||
const re = new RegExp(step.slice(1, -1));
|
||||
const match = re.exec(urlin);
|
||||
if ( match === null ) { return; }
|
||||
if ( match.length <= 1 ) { return; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue