有没有办法使用 Chromium 嵌入式框架 (CEF) 登录 Google / YouTube 帐户?
CEF 中的 Google 登录页面显示
Couldn't sign you in
This browser or app may not be secure.
Try using a different browser. If you’re already using a supported browser, you can try again to sign in.
动机
目标是允许用户在 CEF 中使用 YouTube Premium 功能。
我有一个使用CEF集成YouTube的游戏。 它运作良好,但 YouTube 广告当然很烦人。 我希望 YouTube 登录能够正常工作,这样人们就可以在没有 YouTube 广告的情况下使用 YouTube Premium。遗憾的是,这不起作用,因为人们无法登录他们的 Google 帐户,因此无法访问 YouTube Premium。
设置 Google 允许的浏览器
User-Agent
可能会起作用。
例如,这对我有用:
setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0");
但请注意,Google 可能随时更改允许的浏览器列表。所以,这只是一个解决方法。