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.

x64 Options

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

x64 Options

Post 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?
User avatar
salvadordf
Posts: 4066
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: x64 Options

Post 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.
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: x64 Options

Post 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
User avatar
salvadordf
Posts: 4066
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: x64 Options

Post 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.
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: x64 Options

Post by dilfich »

Here's how it works.. :?

Code: Select all

GlobalCEFApp.AcceptLanguageList:= 'ru-RU';
Can there and FOptions need to do?
User avatar
salvadordf
Posts: 4066
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: x64 Options

Post 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.
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: x64 Options

Post by dilfich »

RAD Studio 10.2 doesn't work either.. :(
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: x64 Options

Post 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. :(
User avatar
salvadordf
Posts: 4066
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: x64 Options

Post by salvadordf »

This could be a memory alignment issue in the settings record.
I'll take a look as soon as I can.
User avatar
salvadordf
Posts: 4066
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: x64 Options

Post by salvadordf »

I uploaded the fix for this issue.

Please, download CEF4Delphi again.
Post Reply