Modifying response headers in onHeadersReceived event of webRequest to initiate a “Save as” window
Modifying response headers in onHeadersReceived event of webRequest to initiate a “Save as” window I'm experimenting with web extensions and trying to modify the response headers to make the results of the XMLHttpRequest() downloadable by setting the Content-Disposition to attachment. Right now, I'm just attempting to replace the response headers received with the three most basic for intitiating a download as described in this MDN Web Doc. And I think the code is consistent with this very brief example provided in the webRequest web doc, which is modifying the request header. I have the webRequest and webRequestBLocking permissions and host permission for all_urls in the manifest.json file. After this code completes, when I write out the response headers received by the GET request it remains unchanged. I'm sure this code runs because I send messages back to the content script from within at each stage; and the onHeadersReceived event completes before the onreadystatechang...
