[英]CLOSE | Chrome Tab | Javascript
Please help me with closing a Chrome Tab using Javascript. 请帮助我使用Java脚本关闭Chrome标签页。 I tried these - But all are failing.
我尝试了这些-但都失败了。
open('about:blank', '_self').close(); - This opens up a new tab, and the user is able to browse back. Which is not required.
open(location, '_self').close(); - Scripts may close only the windows that were opened by it.
window.open('','_parent','');
window.close(); - Not working
As far as i know Chrome and Firefox have removed this feature of closing tab through JavaScript . 据我所知,Chrome和Firefox已删除了通过JavaScript关闭标签页的功能。 Not sure about IE.
不确定IE。 Yet you can try this, it might work (Remember you can only close those tabs which you yourself have opened through script) Try
但是您可以尝试一下,它可能会起作用(请记住,您只能关闭自己通过脚本打开的选项卡)
windows.top.close(); windows.top.close();
Hope this helps! 希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.