chrome undo the action of "prevent this page from creating additional dialogs"

177,106

Solution 1

No. But you should really use console.log() instead of alert() for debugging.

In Chrome it even has the advantage of being able to print out entire objects (not just toString()).

Solution 2

Close the tab of the page you disabled alerts. Re-open the page in a new tab. The setting only lasts for the session, so alerts will be re-enabled once the new session begins in the new tab.

Solution 3

So the correct answer is: YES, there is a better way.

Right click on the tab and select "Duplicate", then close the original tab if you wish.

Alerting is re-enabled in the duplicate.

The duplicate tab seems to recreate the running state of the original tab so you can just continue where you were.

Solution 4

2 more solutions I had luck with when neither tab close + reopening the page in another tab nor closing all tabs in Chrome (and the browser) then restarting it didn't work:

1) I fixed it on my machine by closing the tab, force-closing Chrome, & restarting the browser without restoring tabs (Note: on a computer running CentOS Linux).

2) My boss (also on CentOS) had the same issue (alerts are a big part of my company's Javascript debugging process for numerous reasons e.g. legacy), but my 1st method didn't work for him. However, I managed to fix it for him with the following process:

  • a) Make an empty text file called FixChrome.sh, and paste in the following bash script:

    #! /bin/bash
    cd ~/.config/google-chrome/Default     //adjust for your Chrome install location
    rm Preferences
    rm 'Current Session'
    rm 'Current Tabs'
    rm 'Last Session'
    rm 'Last Tabs'
    
  • b) close Chrome, then open Terminal and run the script (bash FixChrome.sh).

It worked for him. Downside is that you lose all tabs from your current & previous session, but it's worth it if this matters to you.

Solution 5

open a new window or tab with the same link.. the PREVENT option lasts per session only..

Share:
177,106
prongs
Author by

prongs

Updated on October 10, 2020

Comments

  • prongs
    prongs over 3 years

    I sometimes find that I need to re-enable alerting for debugging. Of course I can close the tab and reload it but Is there a better way?

  • Bjorn
    Bjorn over 10 years
    Alerts are useful because they affect timing. And web inspector console.log statement introspection can sometimes happen after a bunch of code executed after the console log hiding the state at the line when the console.log state was executed.
  • Ionică Bizău
    Ionică Bizău over 10 years
    @BjornTipling For that you can use debugger or a break point.
  • Mr. Lance E Sloan
    Mr. Lance E Sloan over 10 years
    Does your answer "no" mean there isn't any other way to re-enable alerts or that you think the asker shouldn't be using alerts?
  • fejese
    fejese about 10 years
    Although it certainly resets the alert issue but it should be used with caution, since it resets all settings. There's no way there to select what you want to reset. Also I don't believe it's simpler than refreshing the page
  • Per Salbark
    Per Salbark over 9 years
    I know my answer didn't directly answer the question the way it was worded, but it provided the information that the original poster was seeking. As for Dentaku's answer, I can say with some confidence that it is not the correct answer, since the original poster specifically says he knows about that solution and is seeking something else.
  • Jeff Puckett
    Jeff Puckett about 8 years
    how does this differ from the OP's note that Of course I can close the tab and reload it but Is there a better way?
  • RobM
    RobM almost 8 years
    FYI, if you middle click the refresh icon it duplicates the tab. Middle-clicking back / forward buttons open their pages in new tabs too. Pretty handy.
  • ejbytes
    ejbytes over 7 years
    Although debugging tools are great, sometimes it's good to just print to screen without looking through debugger code. It's clean. You don't have to agree, but I agree with this answer.
  • macm
    macm over 7 years
    Unfortunately Google has indexed this as the answer... its terrible. don't do it.
  • Cagatay Ulubay
    Cagatay Ulubay over 7 years
    It's 2017 and a bit late, but as for I am seeking this informaton and found this thread, I want to add following: The statement self is perfectly correct and one should use console.log , debugger or break points for debugging. But answer is wrong to the question. There a few cases where you actually want to use something like Javascript confirm(); and when you press the checkbox, the dialog box will be prevented to show. So the question is: Can you still undo this or even prevent this, because you WANT this dialog box for your own page (not for annonying advertisements)
  • ASalazar
    ASalazar almost 6 years
    @RobM Well, I'll be damned. Never knew middle click could do that as well.
  • Stan
    Stan over 4 years
    From my experience, the phrase "close the original tab if you wish" seems misleading, because until I close the previous tab, the alert does not appear in the new. So the original tab must be closed.