Page 1 of 1

CEFuseragent does not work

Posted: Sat Jul 04, 2020 11:37 pm
by andreykrasnodar
If I type

Code: Select all

  CEFuseragent:='mybrowser';
after

Code: Select all

CefLoadLibDefault
it doer not change my browser. Websites don't see string 'mybrowser'.

Re: CEFuseragent does not work

Posted: Sun Jul 05, 2020 7:49 am
by dilfich

Code: Select all

procedure CreateGlobalCEFApp;
begin
  GlobalCEFApp                      := TCefApplication.Create;
  GlobalCEFApp.UserAgent      := 'mybrowser'; 
Only globally but for sure it can be installed via DevToolsMethod, but I don't know an example. That would be interesting. Since the header doesn't change completely and you can see it using JS. But installing via DevTools changes completely.
I think it is worth all the settings of CEF4Delphi that only change the headers to rework through DevTools.

Re: CEFuseragent does not work

Posted: Sun Jul 05, 2020 8:30 am
by andreykrasnodar
It was funny but I changed 2 strings and it works

in past

Code: Select all

CefLoadLibDefault
CEFuseragent:='mybrowser';
now

Code: Select all

  CEFuseragent:='mybrowser';
CefLoadLibDefault

Re: CEFuseragent does not work

Posted: Sun Jul 05, 2020 8:44 am
by dilfich
There is a standard way, why invent something?)