I can't seem to get window.onblur to work properly.
window.onblur = console.log('blur');
When the listener is applied to the window, it just runs when the page is loaded, but not when the window looses focus.
window.onblur = function() { console.log('blur'); }