101 字
1 分钟
window.close注意事项
现象
直接使用window.close()在一些情况下会触发Scripts may close only the windows that were opened by them.导致关闭失败。正常通过链接跳转或者新tab装了插件通过地址栏打开,都不会触发。但是如果在无痕中,没有tab插件直接在地址栏中输入后回车,就会触发限制导致tab无法被js关闭。
window.close注意事项
https://darknesschaser.github.io/2025/03/11/window.close注意事项/