(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:
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.