Page 1 of 2

x64 Options

Posted: Mon Nov 19, 2018 1:01 am
by dilfich

Code: Select all

Chromium1.Options.Javascript:= STATE_DISABLED;
On Chrome x64 does not work any of the settings, do not understand what I'm doing wrong? I'm switching platform 32 and it's working.

But at the same time, for example.. also not working.

Code: Select all

Chromium1.Options.AcceptLanguageList:= 'gb-GB';
If you specify through RequestContext everything works!

Code: Select all

TempContext := TCefRequestContextRef.New('', 'gb-GB', False, False, False, False);
How to make other settings work?

Re: x64 Options

Posted: Mon Nov 19, 2018 8:52 am
by salvadordf
I tested those options in Lazarus and they work.

Please, make sure the you are modifying TChromium.Options before the TChromium.CreateBrowser call.

Re: x64 Options

Posted: Mon Nov 19, 2018 9:11 am
by dilfich
Demo MiniBrowser
RAD Studio 10.1 Berlin

Code: Select all

procedure TMiniBrowserFrm.FormShow(Sender: TObject);
begin
  ShowStatusText('Initializing browser. Please wait...');

  Chromium1.Options.AcceptLanguageList:= 'ru-RU,ru';

  // WebRTC's IP leaking can lowered/avoided by setting these preferences
  // To test this go to https://www.browserleaks.com/webrtc
  Chromium1.WebRTCIPHandlingPolicy := hpDisableNonProxiedUDP;
  Chromium1.WebRTCMultipleRoutes   := STATE_DISABLED;
  Chromium1.WebRTCNonproxiedUDP    := STATE_DISABLED;

  // GlobalCEFApp.GlobalContextInitialized has to be TRUE before creating any browser
  // If it's not initialized yet, we use a simple timer to create the browser later.
  if not(Chromium1.CreateBrowser(CEFWindowParent1, '')) then Timer1.Enabled := True;
end;
Test :(
32 bit - Accept-Language: ru-RU,ru;q=0.9
64 bit - Accept-Language: en-US,en;q=0.9

Re: x64 Options

Posted: Mon Nov 19, 2018 9:45 am
by salvadordf
I still haven't upgraded to the latest Delphi Community Edition and I can't test this in 64 bits because I only have an "old" Delphi Starter license.

This is what I get when I use Lazarus to build the SimpleLazarusBrowser in 64 bits.
Image

SimpleLazarusBrowser is the equivalent to the SimpleBrowser2 demo for Delphi.

I'll have to ask for a favor to see what's going on with the 64 bit build in Delphi.

Re: x64 Options

Posted: Mon Nov 19, 2018 10:24 am
by dilfich
Here's how it works.. :?

Code: Select all

GlobalCEFApp.AcceptLanguageList:= 'ru-RU';
Can there and FOptions need to do?

Re: x64 Options

Posted: Mon Nov 19, 2018 10:32 am
by salvadordf
Many GlobalCEFApp properties are used to initialize CEF3 globally while the TChromium.Options properties are used in the browser creation.

All of them expose CEF3 settings or command line switches used for the same purposes : CEF initialization and browser creation.

Re: x64 Options

Posted: Mon Nov 19, 2018 11:58 am
by dilfich
RAD Studio 10.2 doesn't work either.. :(

Re: x64 Options

Posted: Thu Nov 22, 2018 5:22 am
by dilfich
Is no one else uses this platform in Delphi or only I do not work..? 32 bit is not suitable for applications with many browsers, after a while just falls asleep\crashes, with 64 no such problems. But without additional settings everything comes to naught. :(

Re: x64 Options

Posted: Thu Nov 22, 2018 8:49 am
by salvadordf
This could be a memory alignment issue in the settings record.
I'll take a look as soon as I can.

Re: x64 Options

Posted: Thu Nov 22, 2018 2:04 pm
by salvadordf
I uploaded the fix for this issue.

Please, download CEF4Delphi again.