mirror of https://github.com/gorhill/uBlock.git
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
|
@ -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 New Issue