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.

CEFuseragent does not work

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

CEFuseragent does not work

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

Re: CEFuseragent does not work

Post 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.
andreykrasnodar
Posts: 112
Joined: Wed Jul 01, 2020 10:22 am

Re: CEFuseragent does not work

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

Re: CEFuseragent does not work

Post by dilfich »

There is a standard way, why invent something?)
Post Reply