-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redirection issue #3590
Comments
Yes, to quote gorhill:
|
Which is probably not intended. The actual code that handles redirection is probably not aware of request party and needs to be adjusted. The parser is easy to fix (still need to figure out how to flag it as diff --git a/src/js/redirect-engine.js b/src/js/redirect-engine.js
index a7d539c..61ca5bf 100644
--- a/src/js/redirect-engine.js
+++ b/src/js/redirect-engine.js
@@ -318,8 +318,8 @@ RedirectEngine.prototype.compileRuleFromStaticFilter = function(line) {
srcs = option.slice(7).split('|');
continue;
}
- if ( option === 'first-party' ) {
- srcs.push(µburi.domainFromHostname(des) || des);
+ if ( option === 'first-party' || option === '~third-party' ) {
+ srcs.push(µburi.domainFromHostname(des) || des || '<flag-first-party>');
continue;
}
// One and only one type must be specified. |
This commit moves the parsing, compiling and enforcement of the `redirect=` and `redirect-rule=` network filter options into the static network filtering engine as modifier options -- just like `csp=` and `queryprune=`. This solves the two following issues: - #3590 - uBlockOrigin/uBlock-issues#1008 (comment) Additionally, `redirect=` option is not longer afflicted by static network filtering syntax quirks, `redirect=` filters can be used with any other static filtering modifier options, can be excepted using `@@` and can be badfilter-ed. Since more than one `redirect=` directives could be found to apply to a single network request, the concept of redirect priority is introduced. By default, `redirect=` directives have an implicit priority of 0. Filter authors can declare an explicit priority by appending `:[integer]` to the token of the `redirect=` option, for example: ||example.com/*.js$1p,script,redirect=noopjs:100 The priority dictates which redirect token out of many will be ultimately used. Cases of multiple `redirect=` directives applying to a single blocked network request are expected to be rather unlikely. Explicit redirect priority should be used if and only if there is a case of redirect ambiguity to solve.
The |
Related issue: - #3590 Since the `redirect=` option was refactored into a modifier filter, presence of a type (`script`, `xhr`, etc.) is no longer a requirement.
Describe the issue
The filter
does not lead to a redirection of the request.
One or more specific URLs where the issue occurs
Steps for anyone to reproduce the issue
Disable
uBO-unbreak
Go to
the video will not play because of the blocked
content/libs/comscore/comscore.min.js
request.Add
*/content/libs/comscore/comscore.min.js$script,first-party,redirect=noopjs
to your filter list and reload.The video will still not play and the logger shows that no redirection has occurred.
Add
*/content/libs/comscore/comscore.min.js$script,~third-party,redirect=noopjs
to your filter list and reload.The video will play and the logger shows a successful redirection.
Your settings
Your filter lists
Default
The text was updated successfully, but these errors were encountered: