window.close()不起作用
js中使用window.close()关闭页面时,发现chrome和firefox不起作用且firefox没有任何提示,很烦人。而chrome会报“Scripts may close only the windows that were opened by it”。
解决办法:
1.针对firefox:
firefox配置:地址栏输入about:config,修改属性“dom.allow_scripts_to_close_windows”为true;
2.针对chrome:
open(location, '_self').close();
相关推荐
86417413 2020-11-25
simonzhao0 2020-11-23
zytyxz 2020-10-28
HappyBlog 2020-10-27
爱读书的旅行者 2020-10-26
del 2020-10-21
WenSenli 2020-10-12
ChromeDisaster 2020-10-11
svap 2020-08-25
simonzhao0 2020-08-17
shayuchaor 2020-08-17
yidaizongshi 2020-08-16
化风 2020-08-14
tiankele0 2020-07-29
maowenbei 2020-07-19
curiousL 2020-07-18
王练 2020-07-18
liuweiq 2020-07-08