每次我尝试使用window.close();
我都会得到错误Scripts may only close the windows that were opened by them
,有没有办法绕过这个?
问问题
37 次
1 回答
1
好像不是。
请参阅文档:
此方法只能在使用该
Window.open()
方法的脚本打开的窗口上调用。如果窗口不是由脚本打开的,控制台中会出现类似的错误:Scripts may not close windows that not open by script。
于 2021-12-17T12:25:53.397 回答