salvadordf / CEF4Delphi

CEF4Delphi is an open source project to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC for Windows, Linux and MacOS.
https://www.briskbard.com/forum/
Other
1.2k stars 365 forks source link

BLOCKED: This browser or app may not be secure. #443

Closed duEuler closed 1 year ago

duEuler commented 1 year ago

Try using another browser. If you are already using a supported browser, try logging in again.

I'm trying to log in to a Google account, but it seems Google is blocking browsers that are unsupported or insecure for them, how can we work around this problem?

Grateful for the attention!

Congrats on the project, it turned out great!

duEuler commented 1 year ago

I was able to solve it using Example in directory demo is name Mobile Browser, activating option the UserAgent update option, success!

duEuler commented 1 year ago

Execute this code, after load webpage:


const
  DEVTOOLS_SETUSERAGENTOVERRIDE_MSGID       = 1;
  DEVTOOLS_SETTOUCHEMULATIONENABLED_MSGID   = 2;
  DEVTOOLS_CANEMULATE_MSGID                 = 3;
  DEVTOOLS_CLEARDEVICEMETRICSOVERRIDE_MSGID = 4;
  DEVTOOLS_SETDEVICEMETRICSOVERRIDE_MSGID   = 5;

// ---------- //-----------//

var
  TempParams : ICefDictionaryValue;
begin

 try
      TempParams := TCefDictionaryValueRef.New;
      TempParams.SetString('userAgent', 'Mozilla/5.0 (Linux; Android 11; M2102K1G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Mobile Safari/537.36');
      FPendingMsgID := DEVTOOLS_SETUSERAGENTOVERRIDE_MSGID;
      Chromium1.ExecuteDevToolsMethod(0, 'Emulation.setUserAgentOverride', TempParams);
    finally
      TempParams := nil;
    end;
salvadordf commented 1 year ago

I'm glad this works in your case. This is the latest forum thread about this issue.

As you can see, Google decided to block all embedded browsers a few years ago but some developers seem to find temporary workarounds.

Thanks for sharing your solution! :)