Get all links
Get all links
Hi, Salvadordf.
Can you please tell me how can I get a list of all the loaded links on a web page?
Can you please tell me how can I get a list of all the loaded links on a web page?
- salvadordf
- Posts: 4089
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Get all links
Hi,
Use the code in the MiniBrowser demo.
Modify the TMiniBrowserFrm.WVBrowser1AfterCreated procedure to filter all resources instead of images and media :
Then modify TMiniBrowserFrm.WVBrowser1WebResourceRequested and read the URL from the request :
Use the code in the MiniBrowser demo.
Modify the TMiniBrowserFrm.WVBrowser1AfterCreated procedure to filter all resources instead of images and media :
Code: Select all
WVBrowser1.AddWebResourceRequestedFilter('*', COREWEBVIEW2_WEB_RESOURCE_CONTEXT_ALL);
Code: Select all
var
TempRequest : TCoreWebView2WebResourceRequestRef;
begin
[...]
TempRequest := TCoreWebView2WebResourceRequestRef.Create(TempArgs.Request);
My_URI_copy := TempRequest.URI;
TempRequest.Free;
end;
Re: Get all links
Thank you very much, it works great.
Re: Get all links
This not get Links + Preflight
is there a solution?
is there a solution?
- salvadordf
- Posts: 4089
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Get all links
Try using the DevTools methods.
Enable the network tracking with "Network.enable" and events like "Network.requestWillBeSent" will be delivered to the client.
Run the SubscribeToDevToolsProtocolEventBrowser demo to see how to use the DevTools methods and read this for more information :
https://chromedevtools.github.io/devtools-protocol/1-3/Network/
Re: Get all links
Please give me example, I am still confused.
Re: Get all links
I have successfully tried it.
The next problem, the link still can not be displayed. From a web link structure loaded by an Iframe from a third party.
Source : https://www.xm.com/research/economicCalendar
I want to get link : https://api.tradingcentral.com/permissions/v3/self?token=xxxxxxxxxxxxxxxxxxxxxxxxxx
I just need "token"
- salvadordf
- Posts: 4089
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Get all links
The two methods commented in this thread are he only way I know to get the a list of loaded resources in WebView2.
I'm sorry but I can't help you.
I'm sorry but I can't help you.
Re: Get all links
Thank you for the help.
Again , how do set active frames in DevTools? like the image below.
Again , how do set active frames in DevTools? like the image below.
- salvadordf
- Posts: 4089
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Get all links
The WebView2 API doesn't have any method or property to set the active frames in the DevTools.
Perhaps there's a DevTools method to do that but I've never done that :
https://chromedevtools.github.io/devtools-protocol/1-3/
Perhaps there's a DevTools method to do that but I've never done that :
https://chromedevtools.github.io/devtools-protocol/1-3/