CEFuseragent does not work

Post Reply
andreykrasnodar
Posts: 40
Joined: Wed Jul 01, 2020 10:22 am

CEFuseragent does not work

Post by andreykrasnodar » Sat Jul 04, 2020 11:37 pm

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'.

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

Re: CEFuseragent does not work

Post by dilfich » Sun Jul 05, 2020 7:49 am

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.

andreykrasnodar
Posts: 40
Joined: Wed Jul 01, 2020 10:22 am

Re: CEFuseragent does not work

Post by andreykrasnodar » Sun Jul 05, 2020 8:30 am

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

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

Re: CEFuseragent does not work

Post by dilfich » Sun Jul 05, 2020 8:44 am

There is a standard way, why invent something?)

Post Reply