目前想到的是
window.close()其他的方法需要查一下资料。似乎没有其他方法了……
This method can only be called on windows that were opened by a script using the Window.open() method. If the window was not opened by a script, an error similar to this one appears in the console: scripts may not close windows that were not opened by script.
引用 MDN 的解释,
window.close只能关闭由
window.open方法打开的页面。网上说在 FireFox 下直接使用
window.close可能会有问题。最好先执行一下
window.open('', '_self') 后再执行 window.close
另外直接指向一个空白页并且让后退失效也是一种代替方案



