I want to execute some code when user activate the browser's tab.
window.onfocus = function() {
console.log('323');
};
On localhost this works, but doesn't work on remote server. Console is empty.
I also tried without success:
$(window).bind('focus', function() {
console.log('323');
});
My browser is Chrome, last version.