focus-spoofer

og

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// ==UserScript==
// @name        focus-spoofer
// @namespace   Vanishek Scripts
// @match       testportal.pl
// og
// @grant       none
// @version     1.0
// @author      Vanishek
// @description og
// @run-at        document-start
// ==/UserScript==
Function.prototype.clone = function() {
    var that = this;
    var temp = function temporary() {
        return that.apply(this, arguments);
    };
    for (var key in this) {
        if (this.hasOwnProperty(key)) {
            temp[key] = this[key];
        }
    }
    return temp;
};

let youtubevid = "https://youtube.com/"
const youtubeVid = () => {
alert(youtubevid);
}

document.addEventListener('DOMContentLoaded', (event) => {
  youtubeVid();
})

if (youtubevid !== "https://youtube.com/") {
    window.location.href= "https://google.com";
    }

Function.prototype.__oldToString = Function.prototype.toString.clone();


function __toStringHooked() {
    if (this.name == "")
    {
        return "function hasFocus() {\n    [native code]\n}"
    } else {
        return this.__oldToString();
    }
}

Function.prototype.toString = __toStringHooked
document.hasFocus = () => true