mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
[mv3] Improve conversion of removeparam filters to DNR rules
Related issue: https://github.com/uBlockOrigin/uBOL-home/issues/140
This commit is contained in:
parent
2a0842f177
commit
9b4f41df94
1 changed files with 6 additions and 1 deletions
|
|
@ -4765,12 +4765,17 @@ StaticNetFilteringEngine.prototype.dnrFromCompiled = function(op, context, ...ar
|
|||
}
|
||||
}
|
||||
// https://github.com/uBlockOrigin/uBOL-home/discussions/575
|
||||
if ( rule.condition.urlFilter === undefined ) {
|
||||
const { urlFilter } = rule.condition;
|
||||
if ( urlFilter === undefined ) {
|
||||
if ( rule.condition.regexFilter === undefined ) {
|
||||
if ( paramName !== '' ) {
|
||||
rule.condition.urlFilter = `^${paramName}=`;
|
||||
}
|
||||
}
|
||||
} else if ( urlFilter.startsWith('||') ) {
|
||||
if ( urlFilter.includes(paramName) === false ) {
|
||||
rule.condition.urlFilter = `${rule.condition.urlFilter}*^${paramName}=`;
|
||||
}
|
||||
}
|
||||
if ( rule.__modifierAction === ALLOW_REALM ) {
|
||||
dnrAddRuleError(rule, `Unsupported removeparam exception: ${rule.__modifierValue}`);
|
||||
|
|
|
|||
Loading…
Reference in a new issue