javascript 在 Chrome 中重新启用 window.alert
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19640361/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Re-enabling window.alert in Chrome
提问by max
I accidently checked the "disable alerts from this site" box in Chrome, and now I cannot get any window.alert to work on my localhost.
我不小心检查了 Chrome 中的“禁用来自该站点的警报”框,现在我无法在我的本地主机上运行任何 window.alert。
I have tried resetting the settings in advanced but no luck.
我曾尝试在高级重置设置,但没有运气。
回答by
Close and re-open the tab. That should do the trick.
关闭并重新打开选项卡。这应该够了吧。
回答by DeadlyChambers
I can see that this only for actually turning the dialogs back on. But if you are a web dev and you would like to see a way to possibly have some form of notification when these are off...in the case that you are using native alerts/confirms for validation or whatever. Check this solution to detect and notify the user https://stackoverflow.com/a/23697435/1248536
我可以看到这仅用于实际重新打开对话框。但是,如果您是一名 Web 开发人员,并且您希望看到一种方法,可以在这些关闭时收到某种形式的通知……如果您使用本机警报/确认进行验证或其他什么。检查此解决方案以检测并通知用户https://stackoverflow.com/a/23697435/1248536
回答by Deshani Tharaka
In Chrome Browser go to setting , clear browsing history and then reload the page
在 Chrome 浏览器中,转到设置,清除浏览历史记录,然后重新加载页面