This new functionality sounds like a superset of NoScript Classic's unprefixed surrogate script. Since NoScript Webext does not support surrogates yet, I would be interested to experiment with using uBlock Origin for this functionality.redirect-rule=
This new option allows to create a pure redirect directive, without a corresponding block filter as would be the case with the redirect= option. For example, consider the following filter:
||example.com/ads.js$script,redirect=noop.js
The above filter will result in a block filter ||example.com/ads.js$script and a matching redirect directive. Now consider this following filter:
||example.com/ads.js$script,redirect-rule=noop.js
The above filter will not cause a block filter to be created, only a redirect directive will be created. Standalone redirect directives are useful when the blocking of a resource is optional but we still want the resource to be redirected should it ever be blocked by whatever mean -- whether through a separate block filter, a dynamic filtering rule, etc.
Two questions:
1) Does this work even if uBlock Origin didn't do the blocking of the resource? e.g. if the resource is blocked by NoScript, will uBlock Origin still perform the $redirect-rule? Or would another addon blocking the resource create a race condition?
2) I think I should be able to combine this with https://github.com/gorhill/uBlock/wiki/ ... eslocation to add back custom surrogates (that are not default part of uBlock Origin). I couldn't find documentation of the details of user resources file format, but it appears it's of the form:
Code: Select all
[comments lines starting with "# "]
[resource-name] [MIMEtype]
[resource data, can't contain blank lines]
[2 blank lines]
...