In my JS app Im registering
window.onbeforeunload = function(e) { return "Do you want to exit this page?"; };
This works, but when reloading the page it causes the entire browser to loose focus. I have to click the window so it regains focus. Is there a way around this?
I tried focusing an element, like el.focus() but it's the whole browser that looses focus.
el.focus()
1.4m articles
1.4m replys
5 comments
57.0k users