javascript - Google+ JavaScript API 登录弹出窗口不在 iOS 上返回 Chrome

标签 javascript ios google-chrome google-plus

我正在使用 Google+ Javascript API 登录按钮,它在 Windows 和 Android 上的 Chrome 中运行良好。它在 iPad 和 iPhone 上的 Safari 中也能完美运行。但是,在 iPad 或 iPhone 上使用 Chrome 时,Google 登录的弹出选项卡在单击允许访问后永远不会返回。它似乎是将表单提交到弹出选项卡并且从不返回到原始选项卡。有什么想法吗?

最佳答案

Google 知道此问题,但目前对此无能为力。归结为 window.open 在 UIWebview 中不工作。

Safari is not limited by App Store rules the way all third-party apps are. Apple can use any WebKit APIs they want to, whereas we are constrained to what is possible using UIWebView.

他们鼓励遇到此问题的任何人向 Apple 提交错误。

You can't make Apple do anything, but anyone affected by this can file a bug against Apple about the fact that UIWebView doesn't support window.open and subsequent cross-site scripting, to clearly communicate demand for that support.

There's no way for people to add votes or comments to existing Apple bug reports, so the usual advice is for everyone to file their own.

这是 Apple 中错误报告的 URL:https://bugreport.apple.com

这是一个由 one of the users 提供给 Apple 的错误示例:

Summary: Please add support for window.open and subsequent cross-site scripting to UIWebView. This is blocking Facebook/Twitter/etc login workflows in Chrome for iOS for example

Steps to Reproduce: 1. In a tab, open a page that runs the code var w = window.open(yourURL, null, null); 2. The page at yourURL should try to accesswindow.opener`, such as to postMessage back to the original page 3. Don't profit.

Expected Results: New window can access window.opener.

Actual Results: window.opener is undefined.

Version: 7.0.4

Notes:

Configuration: Chrome Version (from "Settings > About Google Chrome"): 19.0.1084.60 Device Type: iPad 3

可以关注issue thread更新。

关于javascript - Google+ JavaScript API 登录弹出窗口不在 iOS 上返回 Chrome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21532693/

相关文章:

javascript - promise 中的变量

iphone - 在 iPad 上运行 Ruby 解释器

javascript - 类型错误 : Illegal Invocation on console. log.apply

ios - RestKit 0.20.3 + Core Data - 跳过映射操作

google-chrome - 在浏览器中禁用系统中已安装的字体

javascript - Chrome 无法在 ubuntu 上正确编译 java 脚本

javascript - 如何将 html 中的文本内容更改为从 Javascript 中随机生成的值?

javascript - JQuery变量在循环中覆盖,想要保留不同的值

php - 通过 post 方法将坐标从 View 传递到 Controller

ios - 单独的 UIViewController 上的多个 AVPlayer