@[关闭当前浏览器窗口无效问题解决)
关闭当前浏览器窗口无效问题解决
Scripts may close only the windows that were opened by them.
由于谷歌浏览器的安全策略 脚本只能关闭由它们打开的窗口。 所以会导致 window.open(’’, ‘_self’, ‘’) window.close() 无效,规避这一问题的方法是使用js打开新窗口打开当前页面 类似如下:
页面A(将跳转到B的页面)使用js跳转:window.open(‘l要关闭链接地址’,’_blank’)
页面B(想要关闭窗口的页面):在要关闭的那个页面写window.open(’’, ‘_self’, ‘’) window.close(),就好了
vue项目亲测有效