mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 01:02:08 +01:00
Remove requirement for presence of type with redirect=
option
Related issue: - https://github.com/gorhill/uBlock/issues/3590 Since the `redirect=` option was refactored into a modifier filter, presence of a type (`script`, `xhr`, etc.) is no longer a requirement.
This commit is contained in:
parent
f75040afb8
commit
c6d0204b23
2 changed files with 3 additions and 10 deletions
|
@ -42,6 +42,7 @@ a*
|
|||
|
||||
! valid options
|
||||
$script,redirect=noop.js
|
||||
*$redirect=noop.js
|
||||
*$empty
|
||||
*$xhr,empty
|
||||
*$xhr,redirect=empty
|
||||
|
@ -91,9 +92,6 @@ $
|
|||
! bad regex
|
||||
/(abc|def/$xhr
|
||||
|
||||
! can't redirect without type (except to `empty`)
|
||||
*$redirect=noop.js
|
||||
|
||||
! non-redirectable types
|
||||
*$beacon,redirect-rule=empty
|
||||
*$ping,redirect-rule=empty
|
||||
|
|
|
@ -2383,18 +2383,13 @@ const NetOptionsIterator = class {
|
|||
}
|
||||
}
|
||||
}
|
||||
// `redirect=`: requires at least one single redirectable type
|
||||
// `redirect=`: can't redirect non-redirectable types
|
||||
{
|
||||
let i = this.tokenPos[OPTTokenRedirect];
|
||||
if ( i === -1 ) {
|
||||
i = this.tokenPos[OPTTokenRedirectRule];
|
||||
}
|
||||
if (
|
||||
i !== -1 && (
|
||||
hasNoBits(allBits, OPTRedirectableType) ||
|
||||
hasBits(allBits, OPTNonRedirectableType)
|
||||
)
|
||||
) {
|
||||
if ( i !== -1 && hasBits(allBits, OPTNonRedirectableType) ) {
|
||||
optSlices[i] = OPTTokenInvalid;
|
||||
if ( this.interactive ) {
|
||||
this.parser.errorSlices(optSlices[i+1], optSlices[i+5]);
|
||||
|
|
Loading…
Reference in a new issue