Closed Bug 1829404 Opened 2 years ago Closed 2 years ago

DNR redirect rule issue: "The page isn’t redirecting properly"

Categories

(WebExtensions :: Request Handling, defect, P2)

Firefox 113
defect

Tracking

(firefox113 fixed, firefox114 fixed)

RESOLVED FIXED
114 Branch
Tracking Status
firefox113 --- fixed
firefox114 --- fixed

People

(Reporter: rhill, Assigned: robwu)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, Whiteboard: [addons-jira])

Attachments

(1 file)

Link to GitHub issue where this was first reported to me: https://github.com/uBlockOrigin/uBOL-issues/issues/39


Detailed steps to reproduce:

  • Download uBOLite_0.1.23.4076.firefox.mv3.xpi
  • From about:debugging#/runtime/this-firefox, load downloaded package as temporary add-on
  • Option page opens automatically, select Optimal mode (accept permission warning)
  • Scroll down the options page and check the list AdGuard URL Tracking Protection
  • Opens a new tab and navigate to https://example.org/

Result: "The page isn’t redirecting properly"

If I manually remove the first rule in rulesets/removeparam/adguard-spyware-url.json, the navigation stops failing. It is this one particular rule in that one particular ruleset causing the issue, as removing all the other rules in the same ruleset does not resolve the failure.

I simplified the rule to a minimum with which the issue can be reproduced:

[
 {
  "action": {
   "redirect": {
    "transform": {
     "queryTransform": {
      "removeParams": [
       "__hsfp"
      ]
     }
    }
   },
   "type": "redirect"
  },
  "id": 1
 }
]

If I add a the following condition to the rule, it stops failing:

   "requestDomains": [
        "example.org"
   ],
Assignee: nobody → rob
Blocks: 1687755
Severity: -- → S4
Status: NEW → ASSIGNED
Component: Extension Compatibility → Request Handling
Priority: -- → P2
Product: Firefox → WebExtensions
Whiteboard: [addons-jira]
Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/3e5da67fcc4b Interrupt obvious redirect loop without aborting r=rpl
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch

Comment on attachment 9329798 [details]
Bug 1829404 - Interrupt obvious redirect loop without aborting

Beta/Release Uplift Approval Request

  • User impact if declined: Redirect loop when an extension registers a redirect rule with DNR that ends up not rewriting the URL. DNR is new to Firefox 113.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Small patch that only affects DNR, where the desired behavior is verified by unit tests.
  • String changes made/needed: None
  • Is Android affected?: Yes
Attachment #9329798 - Flags: approval-mozilla-beta?

No changelog needed since I anticipate the uplift getting approved.

However, it would be good to document the behavior here (which is now the same in Firefox and Chrome (Chromium source)). That is:

  • When the redirect action does not change the request, the request is not redirected.
  • (not changed in this bug, but the actual implementation and not documented) if the redirect URL is somehow invalid (e.g. by a redirect.regexSubstitution value that is not a valid URL), the request is not redirected.
  • When not redirected, the request continues as usual.
Keywords: dev-doc-needed

Comment on attachment 9329798 [details]
Bug 1829404 - Interrupt obvious redirect loop without aborting

Approved for 113.0b8.

Attachment #9329798 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Documentation updated in mdn/content PR #26528

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: