Reputation: 9606
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?
Upvotes: 125
Views: 183561
Reputation: 11
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.
Upvotes: 0
Reputation: 1
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...
Upvotes: -2
Reputation: 121
open a new window or tab with the same link.. the PREVENT option lasts per session only..
Upvotes: 4
Reputation: 459
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.
Upvotes: 31
Reputation: 3940
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.
Upvotes: 6
Reputation: 1841
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.
Upvotes: 162
Reputation: 39
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.
Upvotes: 2
Reputation: 3645
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()
).
Upvotes: 64