Bypass IE quot;The webpage you are viewing...quot; pop up(绕过 IE “您正在查看的网页...弹出)
问题描述
有没有办法绕过下面的IE弹出框:
Is there a way to bypass the following IE popup box:
您正在查看的网页正在尝试关闭窗口.你想要_____吗关闭这个窗口?是|否
The webapge you are viewing is trying to close the window. Do you want to close this window? Yes|No
当我将 window.close() 添加到 asp.net 按钮控件的 onclick 事件时会发生这种情况.
This is occurring when I add window.close() to the onclick event of an asp.net button control.
推荐答案
您的 JavaScript 代码只能在没有确认的情况下关闭先前由 window.open() 打开的窗口.这是一种有意的安全预防措施,因为在网页上运行的脚本并不拥有该窗口,并且通过关闭它会丢弃该窗口中的浏览历史记录.
Your JavaScript code can only close a window without confirmation that was previously opened by window.open(). This is an intentional security precaution because a script running on a webpage does not own the window, and by closing it discards the browsing history in that window.
解决方法是有一个欢迎页面"或其他某种页面,该页面首先弹出您要使用 window.open 关闭的窗口,或者告诉您的用户修改他们的浏览器安全设置以允许您的应用程序关闭其窗口.
The workaround is to either have a "welcome page" or otherwise some sort of page that pops up the window you want to close with window.open in the first place, or to tell your users to modify their browser security settings to allow your application to close their windows.
这篇关于绕过 IE “您正在查看的网页..."弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:绕过 IE “您正在查看的网页..."弹出


- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- 输入按键事件处理程序 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01