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.

ChromeRuntime and Proxy

dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

ChromeRuntime and Proxy

Post by dilfich »

Hi, it seems like a similar question was raised, but I didn't find something.
Namely, the problem with the proxy for which authorization is required, how to solve it?
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: ChromeRuntime and Proxy

Post by dilfich »

I tried to add a header, but even in normal mode it doesn't work for some reason. Error ERR_INVALID_ARGUMENT

Code: Select all

...BeforeResourceLoad
....
TempNewMap.Append('Proxy-Authorization', 'Basic ZnJlZXVzZXIxOmZyZWV1c2VyMQ==');
TempNewMap.Append('Proxy-Connection', 'keep-alive');
This is how the connection of one of the VPN extensions looks like

Image
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: ChromeRuntime and Proxy

Post by salvadordf »

The Chrome runtime mode is experimental and some features don't work yet.

Try using command line switches like --proxy-server with this value http://<user>:<pass>@<host>:<port>/, for example :

Code: Select all

GlobalCEFApp.AddCustomCommandLine('--proxy-server', 'http://username:password@myproxy.com:80');
That code line needs to be added before the GlobalCEFApp.StartMainProcess call.
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: ChromeRuntime and Proxy

Post by dilfich »

This is certainly not a solution, but it doesn't work either.
ERR_NO_SUPPORTED_PROXIES
GlobalCEFApp.AddCustomCommandLine('--proxy-server', 'http://0401:oLEFKa@86.18.202.21:7952');

Is it possible to add headers via devtools? I tried, but I couldn't add them at all.

Code: Select all

tab.call_method("Network.setExtraHTTPHeaders", headers={"Authorization": "Basic " + context.base64_message})

Code: Select all

  TempList.SetString('{"Authorization": "Basic 12345"}');
  TempParams.SetValue('headers', TempList);
  Chrom.ExecuteDevToolsMethod(0, 'Network.setExtraHTTPHeaders', TempParams);
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: ChromeRuntime and Proxy

Post by dilfich »

It turned out to add headers, but it still doesn't work

Code: Select all

 Chrom.ExecuteDevToolsMethod(0, 'Network.enable', nil);

  TempHeaders := TCefDictionaryValueRef.New;
  TempHeaders.SetString('Proxy-Authorization', 'Basic ZX45645gUZLYTduM0g=');
  TempHeaders.SetString('Proxy-Connection', 'keep-alive');

  TempParams.SetDictionary('headers', TempHeaders);
  Chrom.ExecuteDevToolsMethod(0, 'Network.setExtraHTTPHeaders', TempParams);
The problem is not only with the "Chrome runtime" in normal mode does not work either
ERR_INVALID_ARGUMENT
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: ChromeRuntime and Proxy

Post by dilfich »

And how to load the extension in ChromeRuntime? It seemed to work before. :?
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: ChromeRuntime and Proxy

Post by salvadordf »

Try to use the command line switch with one of these Chromium builds :
https://chromium.woolyss.com/

If it works in Chromium, it should also work in CEF unless there's a new bug or a regression.

These kinds of problems happen with experimental code.
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: ChromeRuntime and Proxy

Post by dilfich »

It doesn't work, it's probably been like this for a long time.

Thorium_AVX2_111.0.5563.111
But authorization works if you save the login \ password in the extension. Proxy Auto Auth

How do I add an extension here in Chrome Runtime mode? Previously, it was possible.

And error ERR_INVALID_ARGUMENT due to a security breach of changing headers sort of.
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: ChromeRuntime and Proxy

Post by salvadordf »

dilfich wrote: Mon Apr 24, 2023 10:33 am It doesn't work, it's probably been like this for a long time.
Thorium_AVX2_111.0.5563.111
But authorization works if you save the login \ password in the extension. Proxy Auto Auth
If an official Chromium build can't use that proxy and you need to install an extension then all you can do is try to reverse-engineer that extension to try to replicate what it does.
dilfich wrote: Mon Apr 24, 2023 10:33 am How do I add an extension here in Chrome Runtime mode? Previously, it was possible.
And error ERR_INVALID_ARGUMENT due to a security breach of changing headers sort of.
I have a limited experience with the Chrome runtime mode and I only installed an extension from the chrome extension store a few months ago.

Please, remember that CEF4Delphi is only a CEF wrapper, which includes Chromium. Some features are beyond the scope of the CEF4Delphi project.
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: ChromeRuntime and Proxy

Post by dilfich »

salvadordf wrote: Mon Apr 24, 2023 12:44 pm If an official Chromium build can't use that proxy and you need to install an extension then all you can do is try to reverse-engineer that extension to try to replicate what it does.
The problem is not in using a proxy, but in authorizing it.

As soon as the Chrome Runtime mode appeared, it was possible to install the extension, how to do it now?
91 (Mini Browser - CEF4Delphi) version of chrome on the screenshot.

Image

There is an extension in the archive, it is definitely working.
You do not have the required permissions to view the files attached to this post.
Post Reply