IE stop message “the web page you are viewing is trying to close the tab.."

时光总嘲笑我的痴心妄想 提交于 2019-12-12 18:13:41

问题


I have a script on page that will close the web page but when it does that I am getting this pop up message “the web page you are viewing is trying to close the tab. Do you want to close this tab?”

I want to suppress this message. I am using IE and done following settings In IE Tools/Internet Options/Security/(select) Internet Zone> (click) Default Level.

Or, Internet Options>/Security> (select) Internet Zone> Custom> Scripting> Active scripting> Enable. Both the settings didn’t worked for me and I am still getting the message. How can I prevent this?


回答1:


The webpage you are viewing is trying to close this window warning in Internet Explorer

This is a old question and in the awnsers also lays your awnser i quote:

"Javascript can close a window if a javascript code opens it."

Otherwise, it can't. It is just a security feature. I hope i helped :)




回答2:


There are some interesting workarounds on this question, basically revolving around inserting a window.open() somewhere into the sequence.

Bypass IE "The webpage you are viewing..." pop up



来源:https://stackoverflow.com/questions/17300705/ie-stop-message-the-web-page-you-are-viewing-is-trying-to-close-the-tab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!