This question has already been answered:
Good time!
There is a html form. It has a focus loss event. After it there is a check for correctness of filling, if there are errors, pops up alert. The problem is that switching the tab in the browser is also perceived as a loss of focus of the form. If the form has the focus and at this point the user switches the tab, the test starts and the alert pops up. In Mozilla, this is all tolerable, it does not interfere with switching the tab, but in chrome, the alert does not allow you to leave the current page. If you do not prohibit the display of pop-up windows, but simply click on OK, the test works out time after time and the window is displayed again and again.
I tried to attach some check for switching the tab, but: 1 - the switch event works after the event of loss of focus of the form 2 - if you click on the alert, the tab again receives focus and the check is restarted.
Tell me, how can I solve this problem?
window.alert = function(){...}and in the overridden function you can already define what and how to show. - Grundy