Page 2 of 2

Re: Get all links

Posted: Sat Nov 11, 2023 8:54 pm
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

Re: Get all links

Posted: Mon Nov 13, 2023 5:19 pm
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.

Re: Get all links

Posted: Mon Nov 13, 2023 7:44 pm
by Vaytl
Thank you very much for the detailed explanation.