本文翻译自:Re-enabling window.alert in Chrome
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中的“禁用来自此网站的提醒”框,现在我无法在我的localhost上运行任何window.alert。
I have tried resetting the settings in advanced but no luck. 我已经尝试重置高级设置,但没有运气。
#1楼
参考:https://stackoom.com/question/1KPM1/在Chrome中重新启用window-alert
#2楼
Close and re-open the tab. 关闭并重新打开选项卡。 That should do the trick. 这应该够了吧。
#3楼
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. 但是,如果您是一个Web开发人员,并且您希望在这些关闭时看到可能有某种形式的通知的方式...在您使用本机警报/确认进行验证的情况下。 Check this solution to detect and notify the user https://stackoverflow.com/a/23697435/1248536 检查此解决方案以检测并通知用户https://stackoverflow.com/a/23697435/1248536
#4楼
在Chrome浏览器中,转到设置,清除浏览历史记录,然后重新加载页面
本文介绍了解决Chrome浏览器中意外禁用window.alert功能的方法。通过重置浏览器设置、清除浏览历史记录及使用替代通知方案,帮助Web开发者在本地环境中恢复alert功能,确保代码调试与验证过程顺利。
798

被折叠的 条评论
为什么被折叠?



