简体   繁体   English

window.close()在iOS 8 GM种子上不起作用

[英]window.close() doesn't work on iOS 8 GM seed

I am trying to open new tab via Javascript using window.open() , then using window.close() to close, but it seems window.close() doesn't work in safari( iOS 8 GM seed). 我试图通过Javascript使用window.open()打开新选项卡,然后使用window.close()关闭,但似乎window.close()在safari(iOS 8 GM种子)中不起作用。 Here is the code: 这是代码:

A.html: A.html:

<button onclick="window.open('./B.html'); return false;">Open B</button>

B.html: B.html:

<button onclick="window.close();">Close</button>

I tried several ways like: setTimeout , window.open() then close, but doesn't help. 我尝试了几种方式: setTimeoutwindow.open()然后关闭,但没有帮助。

Is there any workaround for this situation? 这种情况有没有解决方法?

There isn't a workaround. 没有解决方法。

I added a message in our web pages. 我在网页上添加了一条消息。 'Please close this window if it does not close automatically.' “如果没有自动关闭,请关闭此窗口。”

There is a forum about this issue. 有一个关于这个问题的论坛。 https://devforums.apple.com/message/1044445 https://devforums.apple.com/message/1044445

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM