I have a private web based app where sometimes I genuinely ask to the users what they want to do in given situations. To do so, I'm using the confirm
function of javascript.
As any other modal box, after a few popups the user has the choice to disable them by simply clicking the little box as showed below:
The problem is that, if they clicked it once, they never see other messages and responses to confirm
are assumed 0
, which is confusing because basically it means that all the actions requiring their confirmation are cancelled with no warning! Refreshing the page does not help, they have to close it and reopen it for it to work again.
Can I detect when they checked that little box?
When that box is checked, the dialog "closes" immediately. You could check to see if the box closes unusually fast:
Although just using CSS and HTML to create modal dialogs would probably be much easier and more consistent across browsers and platforms. I personally don't like Chrome's approach.
Demo: http://jsfiddle.net/tS9G6/4/
I looked a little bit through Chromium's source and that property isn't stored anywhere, so there doesn't seem to be some Chromium-specific property that you can look at.
You can't do anything about it. It's a browser feature.
You can check for the timing -
How to Detect "prevent this page from creating additional dialogs"
This suggests doing the following :