Closed Bug 1904870 Opened 3 months ago Closed 2 months ago

Use nsIHttpChannelInternal setResponseOverride for local script override

Categories

(DevTools :: Debugger, task)

task

Tracking

(firefox130 fixed)

RESOLVED FIXED
130 Branch
Tracking Status
firefox130 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

At the moment, local script override relies on redirecting channels to a data URI.
With nsIHttpChannelInternal's setOverrideResponse, we can provide a response body which will be treated as if it was served from the network.
Thanks to this, we can use it for more than scripts, and we should be able to override html, stylesheets, etc...

Recently I often ran into websites with CSP directives for script which forbid data: usage, making the current local override feature unusable. So it might be worth switching to the new approach on that sole basis.

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Blocks: 1834799
Blocks: 1817050
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c43270a35465 [devtools] Extract helper from NetworkObserver to compute timings r=devtools-reviewers,bomsy https://hg.mozilla.org/integration/autoland/rev/03568d5fac4b [devtools] Use setReplacedHttpResponse for local override r=devtools-reviewers,bomsy https://hg.mozilla.org/integration/autoland/rev/3bde83aa76ea [devtools] Add test for local script override with CSP r=devtools-reviewers,bomsy
Duplicate of this bug: 1817050
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: