How to prevent pages from detecting the user left a page / clicked outside of the window?

Viewed 29

I'm just wondering, is it possible to prevent certain pages from detecting (probably through JS) that I have left the current window environment?

Some pages reset a timer if you leave the active/focused window for something else, for example.

Do I need to use greasemonkey for this?

Thank you

1 Answers

I managed to write a Greasemonkey script for it that works, it prevents pages from knowing you got out (and in) while open:

// ==UserScript==
// @name         Block Page Unfocus
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Prevents webpages from knowing you unfocused the page.
// @author       You
// @include *
// @grant        none
// ==/UserScript==

window.onblur = function() {
 document.activeElement.blur();
 }
window.onfocus = function() {
 document.activeElement.blur();
 }
Related