You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-desktop/js/focus_listener.js

16 lines
293 B
JavaScript

(function () {
'use strict';
var windowFocused = false;
window.addEventListener('blur', function() {
windowFocused = false;
});
window.addEventListener('focus', function() {
windowFocused = true;
});
window.isFocused = function() {
return windowFocused;
};
})();