I want to detect when the user leaves my page( e.g open a new tab) so I can stop a countdown. I did it using:
$(window).blur(function() { //stop countdown }
Because of the isolation of the iframe, clicking inside it counts as a blur for the parent. If the content of the iframe could be brought in with ajax, that would be a better option.