Last active
May 16, 2022 15:26
-
-
Save awcator/801a041990a2037ff367fabbe8e80a7a to your computer and use it in GitHub Desktop.
Greasemonkey module to disable tabswtich detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Match Every Site | |
// @namespace https://targetwebsite.com/ | |
// @version 1.1 | |
// @description Bypass fullscreen/tabswtich/invisbility screen | |
// @author Dev | |
// @match *://*/* | |
// @grant unsafeWindow | |
// ==/UserScript== | |
unsafeWindow.document.hasFocus = function () {return true;}; | |
Object.defineProperty(document, "hidden", { value : false}); | |
document.visibilityState="visible"; | |
unsafeWindow.document.visibilityState="visible"; | |
delete window.document.referrer; | |
window.document.__defineGetter__('referrer', function () { | |
return "https://targetwebsite.com/"; | |
}); | |
for (event_name of ["visibilitychange", "webkitvisibilitychange", "blur"]) { | |
window.addEventListener(event_name, function(event) { | |
event.stopImmediatePropagation(); | |
}, true); | |
} | |
for (event_name of ["visibilitychange", "webkitvisibilitychange", "blur"]) { | |
unsafeWindow.addEventListener(event_name, function(event) { | |
event.stopImmediatePropagation(); | |
}, true); | |
} | |
alert("ASD"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
module to be run with Greasemonkey