在Chrome中重新启用window.alert

本文介绍了解决Chrome浏览器中意外禁用window.alert功能的方法。通过重置浏览器设置、清除浏览历史记录及使用替代通知方案,帮助Web开发者在本地环境中恢复alert功能,确保代码调试与验证过程顺利。

本文翻译自: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浏览器中,转到设置,清除浏览历史记录,然后重新加载页面

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值