-
Notifications
You must be signed in to change notification settings - Fork 0
/
fuckem.js
48 lines (39 loc) · 1.32 KB
/
fuckem.js
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
function fuckem() {
let nonio = getNonioElement();
let body = document.getElementsByTagName('body')[0];
let html = document.getElementsByTagName('html')[0];
if (nonio) {
console.log('fuckNONIO: taking action!')
nonio.style.display = "none";
body.style.overflow = "initial";
html.style.overflow = "initial";
}
}
function getNonioElement() {
let el = null;
//So far all the elements I find, use ID. This needs changing if they change it to a class
let kownIds = ["layer_gattingLN506a75e887198ae510a2c9d5fc90a125", "nonio-basiclogin"];
for (let index = 0; index < kownIds.length; index++) {
const id = kownIds[index];
if (document.getElementById(id)) {
el = document.getElementById(id)
break;
}
}
//ID changes everyday if the website is not using Angular, grabbem by the class
if (!el) {
if (document.getElementsByClassName('gatting_login')[0]) {
el = document.getElementsByClassName('gatting_login')[0].parentNode.parentNode;
}
}
return el;
}
if (document.readyState === 'ready' || document.readyState === 'complete') {
fuckem();
} else {
document.onreadystatechange = function () {
if (document.readyState == "complete") {
fuckem();
}
}
}