1

If you use your browser's devtools you can easily see the JSON as a response to an XHR request in the Networking tab. How to access the same JSON in your own Javascript, e.g. from the context of an browser extension?

I've figured it would be in the window.sessionStorage object but haven't found any leads there.

5
  • 1
    I think you are looking for this Intercept HTTP requests .. but let me tell you it won't be an easy task if you were thinking that sessionStorage was a legit place to look for Commented May 15, 2024 at 14:42
  • 1
    Data only appears in sessionStorage if it's been put there explicitly. Commented May 15, 2024 at 14:45
  • It looks like you're trying to use javascript to retrieve data from the network tab. That won't be possible from a page's javascript. (as you state "e.g from a browser extension", implying other types of javascript such as the page's javascript - could just be a misuse of "e.g.") Commented May 15, 2024 at 14:47
  • A Firefox extension's background script can use webRequest.filterResponseData, while a content script can spoof the built-in XMLHttpRequest and/or fetch, example. Commented May 15, 2024 at 14:52
  • Does this answer your question? Chrome extension to read HTTP response Commented May 15, 2024 at 14:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.