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# 控制相机设备 2022-01-01
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
- 如果条件可以为空 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
- 获取C#保存对话框的文件路径 2022-01-01
- 将数据集转换为列表 2022-01-01
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01
