绕过 IE “您正在查看的网页..."弹出

Bypass IE quot;The webpage you are viewing...quot; pop up(绕过 IE “您正在查看的网页...弹出)
本文介绍了绕过 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 “您正在查看的网页..."弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)
Bind multiple parameters from route and body to a model in ASP.NET Core(在ASP.NET Core中将路由和主体中的多个参数绑定到一个模型)
Custom model binding in AspNet Core WebApi?(AspNet Core WebApi中的自定义模型绑定?)
How to minify in .net core mvc view?(如何在.Net核心MVC视图中缩小?)