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

JavascriptGoogle ChromeAlert

Javascript Problem Overview


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?

Javascript Solutions


Solution 1 - Javascript

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 2 - Javascript

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 3 - Javascript

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 - Javascript

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 - Javascript

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

Solution 6 - Javascript

If you wish dialog box to be re-activated for the page you set as prevent dialog box to show.

Chrome: select settings, a google page for chrome will open with all your settings for chrome.

At the very bottom, go to advance settings and at the bottom of the advance settings you may click on Resset Browser Settings... this will make dialog box appear as they should.

Solution 7 - Javascript

There seems to be a process that suppresses all console.log messages if there are too many alerts in a JS script. That's a problem if you are trying to debug a script. I've been running a script on Chrome and Brave and all of a sudden console.log messages were stopped. Yet with Firefox all the console.log messages still appear... same exact script. The problem is not checking or unchecking the warnings, errors, and debug messages.

I'm at a loss for this... is it Windows blocking "a site"? I tried clearing the cache resetting all settings in Chrome, yet the problem still remains. I suppose I could try reinstalling both browsers.

Solution 8 - Javascript

Turning Hardware Acceleration OFF seems to be the setting that affects popups & dialogs.

Chrome was continually hiding Dialog Windows when I needed to respond Yes or No to things, also when I needed to Rename folders in my bookmarks panel. After weeks of doing this. I disabled all the Chrome helpers in Settings, Also In windows 10 I switched Window Snapping off. It has done something to put the popups and dialogs back in the Viewport.

When this bug is happening, I was able to shut a tab by first pressing Enter before clicking the tab close X button. The browser had an alert box, hidden which needed a response from the user.

Switching Hardware Accleration Off and back On, Killing the Chrome process and switching all the other Helpers Off and back has fixed it for me... It must be in chrome itself because Ive just gone into a Chrome window in the Mac and it has now stopped the problem, without any intervention. Im guessing flicking the chrome settings on/off/on has caused it to reposition the dialogs. I cant get the browser to repeat the fault now...

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionprongsView Question on Stackoverflow
Solution 1 - JavascriptDaveView Answer on Stackoverflow
Solution 2 - JavascriptPer SalbarkView Answer on Stackoverflow
Solution 3 - JavascriptGrahamView Answer on Stackoverflow
Solution 4 - JavascriptAndrew FaulknerView Answer on Stackoverflow
Solution 5 - JavascriptMarwah AbdelaalView Answer on Stackoverflow
Solution 6 - JavascriptYvesView Answer on Stackoverflow
Solution 7 - JavascriptPete SuchslandView Answer on Stackoverflow
Solution 8 - JavascriptTJ SHEPPARDView Answer on Stackoverflow