javascript - 当禁用第 3 方 cookie 时,Google 登录不执行任何操作

标签 javascript google-chrome google-oauth google-signin

我在我的网页上使用 Google 登录 Javascript 库,该库在 Google App Engine 上的 Python 上运行。一切正常,除非用户禁用了第 3 方 cookie(在 Chrome 中)。注册确实会打开帐户选择器(如果适用)并请求权限,但之后什么也没有发生。

在桌面上它返回到注册页面并在控制台中显示以下错误:

Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.

但是我无法检测到这个错误,所以我也无法响应它。在移动设备上,它只会卡在白页上。这里的另一个问题是,由于我要求离线访问,因此第一次注册会返回一个 refresh_token。由于此错误,我从未收到此 refresh_token。

当我加载页面时,上面提到的错误立即显示。我想检测到这一点,以便我可以决定不显示该按钮并要求用户启用第 3 方 cookie。

最佳答案

您可以测试自己是否禁用了第三方 cookie,而不是依赖于 Google 登录库,例如:http://blog.jgc.org/2006/04/do-you-have-third-party-cookies.html

关于javascript - 当禁用第 3 方 cookie 时,Google 登录不执行任何操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33105831/

相关文章:

c# - map 服务器: anyplatfom (opensource or not) to embed into website to query with SQL for further breakdown

javascript - 当您在特定的 div 上时,使用 Javascript 添加/删除类到 <li>。

javascript - 如何访问:id parameter in the route file in ember. js?

javascript - 将数组中的项映射到函数调用中的参数

linux - Native Messaging 主机尝试发送长度为 460151579 字节的消息

oauth-2.0 - 如何在 Dart 中使用 Oauth2 在 Google Fusion Tables 中进行身份验证?

html - Chrome 上的 Canvas 指纹识别

python - 使用python永久更改浏览器(chrome、firefox和edge)的下载路径

oauth-2.0 - Google自定义搜索API的OAuth2范围

node.js - Strategy.OAuth2Strategy.parseErrorResponse 错误 - NodeJS passport google oauth2.0