Is it possible to intercept xhr requests made by the browser? I have a page that I access and after loading it makes some xhr requests and return some data in JSON, how do I get this JSON returned by this request?
thanks!
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Intercept XHR requests
- salvadordf
- Posts: 4580
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Intercept XHR requests
Hi,
There's no easy way to get that body of that response in CEF but it's possible.
Try the ResponseFilterBrowser demo to know how to use a TCustomResponseFilter.
Read the code comments in the source code and the linked documents.
There's no easy way to get that body of that response in CEF but it's possible.
Try the ResponseFilterBrowser demo to know how to use a TCustomResponseFilter.
Read the code comments in the source code and the linked documents.
- salvadordf
- Posts: 4580
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Intercept XHR requests
In general, if you need to intercept the contents of any text resource you can just replace the initial URL in AddressEdt.Text and then edit the IsMyResource function. Set the TempName variable with some unique part of the URL that you need to in intercept.
If the URL request is always the same you can also use the URLRequest demo to send the request manually.
Reading the response is much easier in this case.
If the URL request is always the same you can also use the URLRequest demo to send the request manually.
Reading the response is much easier in this case.