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.
Proxy
- salvadordf
- Posts: 4620
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Proxy
I've never done that. Try using a FILE or DATA URL in GlobalWebView2Loader.ProxySettings.PacUrl.
In any case, WebView4Delphi uses the same command line switches as Chromium to configure the proxy settings.
If you find a way to configure a proxy in Chrome/Chromium with those switches then you should be able to use the same trick in WebView4Delphi.
In any case, WebView4Delphi uses the same command line switches as Chromium to configure the proxy settings.
If you find a way to configure a proxy in Chrome/Chromium with those switches then you should be able to use the same trick in WebView4Delphi.
Re: Proxy
Hello. I use a proxy to work with the browser. My proxies require authorization. I use some solutions that handle this. Not so long ago I got experience with nodejs.js and chromium browser - there are browser commands page.authenticate(login,password). I noticed that the browser on that system and what is used here are very similar and thought that maybe there are these commands here. Could you give me a hint ?
- salvadordf
- Posts: 4620
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Proxy
The WebView2 API doesn't have any function to handle proxy settings.
For now, all we can do is use Chromium command line switches, execute JavaScript code and DevTools methods to try to find workarounds for this and any other missing API features.
I haven't tried "page.authenticate" but I guess you should be able to execute it like any other JavaScript code.
For now, all we can do is use Chromium command line switches, execute JavaScript code and DevTools methods to try to find workarounds for this and any other missing API features.
I haven't tried "page.authenticate" but I guess you should be able to execute it like any other JavaScript code.
- salvadordf
- Posts: 4620
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Proxy
WebView2 doesn't have an API method to set the proxy settings and we have to use command line switches.3vr wrote: Wed Aug 28, 2024 3:41 pm How do I set username and password?
I tried different formats, such as user:password@IP:PORT, but without success.
There's a known issue with proxy authentication :
https://github.com/MicrosoftEdge/WebView2Feedback/issues/3667
https://github.com/MicrosoftEdge/WebView2Feedback/issues/1205
https://github.com/MicrosoftEdge/WebView2Feedback/issues/132
https://github.com/MicrosoftEdge/WebView2Feedback/issues/193
https://github.com/MicrosoftEdge/WebView2Feedback/issues/120
At his moment, I'm afraid this is the only way.3vr wrote: Wed Aug 28, 2024 3:41 pm Another question, to change the proxy, is it necessary to recreate the browser every time?