353

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.

I have tried resetting the settings in advanced but no luck.

max
  • 96,212
  • 14
  • 104
  • 165

3 Answers3

634

Close and re-open the tab. That should do the trick.

  • 2
    Note that you must close all the tabs of the same domain where you opted out of that alert option. – Miguel May 04 '17 at 10:36
  • 1
    Im landed here while im searching information for FireFox, and it works. – inMILD May 14 '17 at 05:09
  • This also worked on my latest Firefox browser. I suggest you update your answer to include this since I didn't find the answer for Firefox (or any other browser)... Note that I have privs enough I could edit it myself, but I try and leave that for the original authors! – Richard T Apr 11 '22 at 15:10
  • I love that user2824854 got 6,000+ rep from "Turn it off and back on again." ...and then closed their SO account! :-D – David Hempy Jan 03 '23 at 19:31
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. Check this solution to detect and notify the user https://stackoverflow.com/a/23697435/1248536

Community
  • 1
  • 1
DeadlyChambers
  • 5,217
  • 4
  • 44
  • 61
  • 4
    For our application there are over 150 confirm windows that rely on the synchronous native confirms. We are planning on changing it, but that would result in us spending two weeks to go through each one of these cases. Plus testing, and we are pushing for a release right now. So this allows us to notify the user that they have managed to check that box in firefox or chrome. – DeadlyChambers May 19 '14 at 14:19
  • I just don't understand what prevents you to override, in this example, `window.alert` with *only* `MySpecialDialog` with [ OK | Cancel ] buttons. IMHO, if the browser itself allows to disable it, this isn't good to rely on it. – Frederik.L Dec 23 '14 at 10:37
  • I clearly understand the feeling of insecurity before a release, but I strongly believe that if good practices can be done with few test cases (ie: OK->continues, Cancel->blocks), it is well worth the time. Maybe, such overpowered system-call-like functions like `alert`, `prompt` and `confirm` will be completely disabled in default settings in a near future as users are more and more annoyed by ads trying to get all the attention using those functions. – Frederik.L Dec 23 '14 at 10:54
  • @Frederik.L to answer your first question the application has been around for a while and has confirms and alerts deeply ingrained into the app. There are a ton of things that are relying on the synchronous behavior. So attempting reenact this is not possible. I know how to utilize callback functions but that could cause me more headaches then it would fix. Your second point you could be right. I could see that, especially with Opera and Chrome making a split from webkit. This could introduce a brand new set of problems. – DeadlyChambers Dec 23 '14 at 15:52
  • @Frederik.L There's also the beforeunload alert which stops users from losing their work, it is also affected by this, and I was dumbfounded trying to figure out why the localized strings broke the alert while doing i18n, until I figured out I had simply tested it one too many times. – falstro Dec 05 '15 at 21:38
3

In Chrome Browser go to setting , clear browsing history and then reload the page

Deshani Tharaka
  • 183
  • 4
  • 14