Skip to content

Instantly share code, notes, and snippets.

@awcator
Last active May 16, 2022 15:26
Show Gist options
  • Save awcator/801a041990a2037ff367fabbe8e80a7a to your computer and use it in GitHub Desktop.
Save awcator/801a041990a2037ff367fabbe8e80a7a to your computer and use it in GitHub Desktop.
Greasemonkey module to disable tabswtich detection
// ==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");
@awcator
Copy link
Author

awcator commented Jul 10, 2021

module to be run with Greasemonkey

@awcator
Copy link
Author

awcator commented Aug 8, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment