27

I was working on a javascript loop that alerted each key value as the loop progressed.

To speed things along, I checked the box "Prevent this page from creating additional dialogs". Usually this only suppresses popups for the one routine, but they haven't come back.

In Google Chrome, alert() messages no longer pop up from that site. Other sites do, but not that site.

Has anyone heard of this before?

Q: How can I reset the alert() messages for that site?

cssyphus
  • 37,875
  • 18
  • 96
  • 111
  • 7
    Maybe Chrome is doing you a favor: forget `alert` and start using the console! – bfavaretto Oct 22 '13 at 21:50
  • 3
    this is a supoer user type of question, but look at the pop up manager https://support.google.com/chrome/answer/95472?hl=en-GB – epascarello Oct 22 '13 at 21:52
  • @Adam You might be right. I've got so many tabs open I was trying everything to avoid that. Please post this idea as an answer so I can accept if it works. – cssyphus Oct 22 '13 at 22:01
  • i recommend the solution from chharvey below as the most elegant solution (close the tab then reopen it) – aequalsb Mar 24 '15 at 17:10

8 Answers8

52

You don't need to restart the browser. Just close the tab and reopen it again. It does not need to be Incognito.

chharvey
  • 8,580
  • 9
  • 56
  • 95
25

Not tested but if you have the problem again I think opening the site in an incognito window will reset the dialogs.

Edit: I added this answer which worked for the Chrome build as it was. Updates might have rendered this unnecessary (appreciate not to be marked down!)

arroni
  • 364
  • 2
  • 6
  • You are absolutely right! Much better solution than bouncing the browser. Thanks. – cssyphus Oct 24 '13 at 15:55
  • 1
    opening a new tab or window works for me as of Chrome 39 - does not have to be incognito – Rocco Dec 12 '14 at 22:09
  • @KjetilNordin: I think it has something to do with cookie/session. Incognito mode doesn't maintain your cookie. Of course a guy at Google read this answer and fix the problem. – Hoàng Long Feb 29 '16 at 03:53
8

Restart the browser, that should reset that option and show you new dialog boxes.

Adam
  • 43,763
  • 16
  • 104
  • 144
3

FROM THE OP:

The solution was to restart the browser. Lose all my tabs? No!!!

However, there's a way to restart your browser and not lose all your tabs.

Install the Session Manager add-on. There is a version of Session Manager for both Chrome and for Firefox.

Session Manager maintains a running list of your open tabs and will automatically ask you if you want to re-open them ("recover your session") after an unexpected reboot or system crash.

Additionally, Session Manager will let you save your tabs on demand and reload them at a later time, or after a reboot. You can save your "session" (all open tabs) any time you want, and give the session whatever name you want.

Finally, when reloading a previous session, you can also choose which tabs to re-open and which tabs to ignore.

Can't live without it, in either Chrome or Firefox.

Chrome extension

Firefox extension

And if you are using IE . . . well, you have other problems.

cssyphus
  • 37,875
  • 18
  • 96
  • 111
  • I don't think you need extensions for this, because the browser itself will have properties to set as in On startup you can choose to `continue where you left off` and you can find this in browser settings... – Guruprasad J Rao Mar 14 '16 at 13:11
2

If you want to detect if these are being blocked. You will have to do your own thing with the message you will be dispalying but override the native alert/confirm.

window.nativeAlert = window.alert;
window.alert = function (message) {
var timeBefore = new Date();
var confirmBool = nativeAlert(message);
var timeAfter = new Date();
if ((timeAfter - timeBefore) < 350) {
    MySpecialDialog("You have alerts turned off, turn them back on or die!!!");
  }
}

window.nativeConfirm = window.confirm;
window.confirm = function (message) {
var timeBefore = new Date();
var confirmBool = nativeConfirm(message);
var timeAfter = new Date();
if ((timeAfter - timeBefore) < 350) {
    MySpecialDialog("You have alerts turned off, turn them back on or die!!!");
}
 return confirmBool;
}

Obviously I have set the time to 3.5 milliseconds. But after some testing we were only able to click or close the dialogs in about 5 milliseconds plus

DeadlyChambers
  • 5,217
  • 4
  • 44
  • 61
  • What's the logic behind this? I get what each line does, but why does this "discover" if the alert is suppressed? – Sean Kendle Apr 06 '15 at 14:16
  • We are using frames (yuck) and the user was able to turn them off on one page and then not see them anywhere else. This is a problem because some validation is dependent on the confirm callback (yuck again). The returned value is false when the confirms are blocked. Even worse the confirm doesn't show. So the user submits and has no idea why the page doesn't do anything. Workaround for poor design, trust me I hate it but a legacy app that is massive. The workaround saved us a ton of time. – DeadlyChambers Apr 06 '15 at 17:13
  • Thanks for that explanation, but my question wasn't about the necessity to check for alert suppression, but why that code works to tell you that it's been suppressed. I'm not understanding why 3.5 milliseconds later it's clear that the alert was suppressed. Who can click an alert in 3.5 milliseconds? I'm confused. – Sean Kendle Apr 06 '15 at 18:59
  • Also: The "or die" phrase - is that a PHP inside joke? Haha! – Sean Kendle Apr 06 '15 at 19:00
  • Oh, well it works for that very reason. Nobody could possibly click the ok/cancel button in 3.5 milliseconds. Unless they got it by hitting return and didn't remove the finger from the key. I got the idea from firefox which was checking if two alerts were opened within a second of each other then the checkbox is displayed. Anyways when a native popup is opened in the browser operations are halted until the dialog is resolved (closed or buttons are hit). Since the browser doesn't display a dialog it runs through these functions almost immediately. I hope this makes a little bit more sense. – DeadlyChambers Apr 06 '15 at 21:04
  • 2
    @SeanKendle I like to strike fear into the heart's of my users, I have found that death threats work pretty well. – DeadlyChambers Apr 06 '15 at 21:06
1

Put this line at the end of body, may be DOM is not ready yet when compiler reads this line

<script type="text/javascript" src="script.js"></script>"
RobertoFRey
  • 674
  • 1
  • 5
  • 10
0

All you have to do is restart your browser. Try it on another browser and see if it works, if it does work (i.e, are you able to see your pop up?), then you should just be able to restart your browser to fix it.

This happened to my on google chrome and I fixed it by quitting and re=opening my browser.

0

Roberto's answer regarding the placement of the script command before the end of body worked for me. I had spent hours trying to figure out why my console command was not working.

Winston
  • 1
  • 1