1

I want to read the JSON returned by some XHR requests on a particular website. Is this possible with the new manifest version 3 for Chrome Extensions?

In that case, how does one accomplish it with declarativeNetRequest or similar?

dani
  • 4,880
  • 8
  • 55
  • 95
  • 1
    Does this answer your question? [Chrome extension to read HTTP response](https://stackoverflow.com/questions/8939467/chrome-extension-to-read-http-response) There are also limited solutions [here](/q/8939467) and re-fetching the URL directly. There's no way to use declarativeNetRequest for this. – wOxxOm Mar 20 '23 at 22:09
  • Thank you, what I don't get is how to capture the Reponse from injected.js here: https://stackoverflow.com/a/48134114/104059 I can see that it changes the XHR.prototype but do I need to dispatch an event, or how would my content-scripts be able to make use of the HTTP Response data? – dani Mar 21 '23 at 18:31
  • Yes, send a CustomEvent, [example](https://stackoverflow.com/a/19312198). – wOxxOm Mar 21 '23 at 19:38

0 Answers0