Open Bug 1587426 Opened 2 years ago Updated 2 months ago

[meta] Fetch.continueRequest

Categories

(Remote Protocol :: CDP, task)

task
Not set
normal

Tracking

(Not tracked)

People

(Reporter: whimboo, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs, )

Details

(Keywords: meta, Whiteboard: [method=Fetch.continueRequest] )

No description provided.

Kris: this bug is part of implementing the CDP Fetch domain in Firefox. The featureset is that you are able to provide a filter on url (or a couple of other things) and for requests matching the filter, block the request and allow client code to modify parts of the request and reponse. AFAICT the featureset is mostly compatible with the WebExtension StreamFilter API, but it isn't fully obvious to me how easy that is to reuse outside the WebExtension context; afaict from reading the code it's a DOM API that's only enabled if some extensions permissions are set?

Does it seem plausible that the existing code covers most of the requirements here, and if so how much work is required for us to use it? Can we just grant ourselves the relevant permissions or is there something different we should be doing?

Flags: needinfo?(kmaglione+bmo)
Component: Page → Fetch
Whiteboard: [method=Fetch.continueRequest] → [puppeteer-alpha]
Whiteboard: [puppeteer-alpha] → [puppeteer-alpha] [method=Fetch.continueRequest]

The implementation of this method is blocked on bug 1591389 for now which will add basic support for the Fetch domain.

While this method is not directly used by Gutenberg e2e tests, the frequency of calls is kinda high:

1091 Fetch.continueRequest

We should keep it on the list for alpha but re-evaluate it later.

Depends on: 1591389
Whiteboard: [puppeteer-alpha] [method=Fetch.continueRequest] → [method=Fetch.continueRequest]

(In reply to James Graham [:jgraham] from comment #1)

Kris: this bug is part of implementing the CDP Fetch domain in Firefox. The featureset is that you are able to provide a filter on url (or a couple of other things) and for requests matching the filter, block the request and allow client code to modify parts of the request and reponse. AFAICT the featureset is mostly compatible with the WebExtension StreamFilter API, but it isn't fully obvious to me how easy that is to reuse outside the WebExtension context; afaict from reading the code it's a DOM API that's only enabled if some extensions permissions are set?

Does it seem plausible that the existing code covers most of the requirements here, and if so how much work is required for us to use it? Can we just grant ourselves the relevant permissions or is there something different we should be doing?

Yes, at least in principal you should be able to use it. In theory, all you should have to do is create a WebExtensionPolicy object, then create a ChannelWrapper for the channel, and register the extension as being able to filter it:

https://searchfox.org/mozilla-central/rev/40b561b9accbff54387edcba2b8b4a3c3828110e/dom/chrome-webidl/ChannelWrapper.webidl#194-198

Then you can use StreamFilter.create with the ID of your policy object and of the channel. I can't tell you off hand how smoothly it will go, though.

Flags: needinfo?(kmaglione+bmo)
Component: CDP: Fetch → CDP
You need to log in before you can comment on or make changes to this bug.