0

I try to monitor a shop with a Tampermonkey script to get a notify-message if products are available. The shop sends automaticly GET-requests every 5 seconds. Is it possible to catch the response of such a request without starting the request in my script?

I don't need an interception. I just want to read out the last request like it is stored in the Network-Record in DevTool in Chorme

ReXel
  • 1
  • 1
  • Override `fetch()` or the `XMLHttpRequest` prototype. See: [Intercept `fetch()` API requests and responses in JavaScript](https://stackoverflow.com/q/45425169) and [Add a "hook" to all AJAX requests on a page](https://stackoverflow.com/q/5202296). – double-beep Feb 20 '23 at 13:40
  • 1
    I don't need an interception. I just want to read out the last request like it is stored in the Network-Record in DevTool in Chorme – ReXel Feb 20 '23 at 14:59
  • What do you mean "read" a request? – double-beep Feb 20 '23 at 15:29
  • In the network-record in DevTools I can see the last requests. I need the headers of the last request to start an own request via Tampermonkey. Is there a possibility to accsess these recorded requests via script? – ReXel Feb 20 '23 at 16:02
  • In your question, you mention you want to access the response text of the requests, something that is possible via the code posted in the answers of the questions linked. Accessing request headers is *much* more complicated (if not impossible). – double-beep Feb 20 '23 at 16:09

0 Answers0