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.

Get all links

Vaytl
Posts: 22
Joined: Tue Jan 04, 2022 12:52 pm

Re: Get all links

Post by Vaytl »

Hi, Salvadordf.
salvadordf wrote: Tue Mar 07, 2023 8:44 am Then modify TMiniBrowserFrm.WVBrowser1WebResourceRequested and read the URL from the request
Please tell me how I can get the response body of a specific URL?

Code: Select all

if TempRequest.URI = 'https://website' then
User avatar
salvadordf
Posts: 4079
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Get all links

Post by salvadordf »

The MiniBrowser demo shows how to do that.

See the TMiniBrowserFrm.WVBrowser1WebResourceResponseReceived procedure :
https://github.com/salvadordf/WebView4Delphi/blob/c58854a5441ab766b6ff2c60ff0a246bb3d6d59f/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas#L858

And the TMiniBrowserFrm.WVBrowser1WebResourceResponseViewGetContentCompleted procedure :
https://github.com/salvadordf/WebView4Delphi/blob/c58854a5441ab766b6ff2c60ff0a246bb3d6d59f/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas#L900C11-L900C79

You can check the URI of the resource request like I commented previously :
https://www.briskbard.com/forum/viewtopic.php?p=8883#p8883

The call TempResponse.GetContent(TempHandler); if that's the URI you want and the TWVBrowserBase.OnWebResourceResponseViewGetContentCompleted event will be triggered. Read the code comments in MiniBrowser.
Vaytl
Posts: 22
Joined: Tue Jan 04, 2022 12:52 pm

Re: Get all links

Post by Vaytl »

Thank you very much for the detailed explanation.
Post Reply