-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
content.js
214 lines (190 loc) · 16 KB
/
content.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
$("head").append(`<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-dark@3/dark.css">`);
chrome.storage.sync.get(['safetymode'], function(data) {
const safetymode = data.safetymode;
console.log("Is Safety Mode enabled?: " + safetymode);
if (safetymode == undefined) {
Swal.fire({
title: 'DISCLAIMER',
html: `By clicking 'I agree', you understand that your server could get banned off Disboard if you use this extension. Use this at your own risk.`,
icon: 'warning',
confirmButtonText: '<b>I agree</b>'
}).then(() => {
Swal.fire(
'Hey!',
`Please open the extension popup (by clicking on the extension icon) at least once before using this extension.
Once you have opened the popup, please press 'OK'.`,
'warning'
).then(() => {window.location = window.location});
});
};
function defineTabID(ServerID) {
var iPageTabID = sessionStorage["tabID"];
if (iPageTabID != ServerID) {
//var iLocalTabID = localStorage["tabID"];
var iPageTabID = ServerID;
localStorage["tabID"] = iPageTabID;
sessionStorage["tabID"] = iPageTabID;
}
}
var ID = sessionStorage.getItem("tabID");
if (!ID) {
Swal.fire(
'Hey!',
'Please select the server to be auto bumped.',
'error'
)
}
setTimeout(function(){ // allows the bump button to load it's timer text (00:00:00) before checking if it should be bumped - a temporary and unreliable fix to the captcha popup problem but it works ¯\_(ツ)_/¯
const lang = $("html").attr("lang") == "en" ? "" : "/" + $("html").attr("lang").toLowerCase();
$(`[href]:not(.languages > li > a):not([href^="${lang}/server/bump/"])`).attr("target", "_blank");
var d = new Date(),
h = (d.getHours()<10?'0':'') + d.getHours(),
m = (d.getMinutes()<10?'0':'') + d.getMinutes(),
s = (d.getSeconds()<10?'0':'') + d.getSeconds();
Object.defineProperty(document, "hidden", { value : false});
$(".navbar-start").append(`<a class="navbar-item" id="bump" title="Made by Theblockbuster1!">
<span class="icon"><span class="icon-robot"></span></span>
<span style="background-image: linear-gradient(to left, orange, red);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;" class="text" id="bumpcount" >Autobumper Enabled: 00:00:00</span>
</a>`);
$(".tabs ul").append(`<li style="margin-left: auto;" title="${d}">
<a>
<span class="icon is-small"><i class="icon-sync"></i></span>
<span>Page Loaded: ${h}:${m}:${s}</span>
</a>
</li>`);
$("div.servers.columns div.block:has(a.button)").prepend(`<a class="button is-dark" id="pick">
<span class="icon"><img src="data:image/gif;base64,R0lGODlhLgAyAOU/AAICAwiRMZsDYhJOJ56MFSAC3xDQIE8TEKRHHEqQF05KPR4tHn0C5ILDRisKJAKR5lwtFQJSiQLPqetZAltOssKCUl8Cq7JOsg2uGkyarN8CzjECXVrFTFYmUxNvI56ens7OzsUDXVK+sX03f5E3GhLuG7TILAI44wKso3buApdwGEI2ehFwgVtwF2Zsg+evCZ+tFl+xIDaIOcJUeQLswALBdDqGis7uAl0CVBEtXXeNEzZNffb29gKuZqsClwAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJFAA/ACwAAAAALgAyAAAG/8CfcEgsGo/IpHLJbDqf0Kh0Sq1ar9hsEsDlap1cEgly6AK+WwhpwmaTHF00EXCYONr4ydsrByAmB395bSR8XwBuEIN5EIZYfmx3g4JsCHBaAIqAlG10eWVCcY5glZp4B2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IUmiADL9U2FJxMCBFCgxVAKyYTKHyjpmEkKyg4ILCjiytJlUebXmtpM2kR+cYuyB15dWAAbhW7fLIgh2dK5s2Inv2yDJRfmdG7XnFGGDH8er7SyYIACH5BAUUAD8ALAYABgAlACkAAAb/wJ9wSBwCjoCicslUAnACnMOBbFqbAJ9mqwnhcNWrGODgmreCo/j6PJ9D6jUTEDoL7En5snwG3LlweXpGfFxpf1xUg0RtZiGIWyGKi0JZbm4+YJRIl24OmnJIEGmdZlKgbGQKCgdkpWhUYXMAqy4KIFQOda8CVAetglVkIDwfHzw8LsaFpWmqLrHKSQDHCg4gx9gfOGY+u2dUCwofDrfIC0er4uhION8aUu9bYAvEH8TJ0y48t+iVkPD8eFKWTcGCWD9ofSATDGAIeRoE7Fu4wAUAHiCgVYpjhNsrLgynOTjGw98cj68ycaRW0ZoVMgJiyozyJReqhB8UcJz1peaXlZg4tAQqsvOlRypcToERRGkjAGBIgDWd08rIgUlTiVa1yjRrQgdbv5LomvUp06djvTJKa5Wt2oRuEx6I6xWAWySyyprNA2CAAQzs1AL4G4AvkgU52JFNdXjlCgqQIa9AOAbAgseRzwLAHJnCiqJEAeToDBnrRgecJS/emNqzaUZHUHs2uWQz6cCMQTPijPutkZC6pwYBACH+a6kgMjAwMyBBUkchIENhcnRvb24gQW5pbWF0aW9uDQpodHRwOi8vYXJ0aWUuY29tDQpBIGRpdmlzaW9uIG9mIENpdHlTdGFyIEdyb3VwLCBJbmMuDQooNzE5KSA1NTktMTk0NQFVU1NQQ01UADs=" alt="Bump Me!"></span>
</a>`);
$(document).on("click", "#pick", function () {
$(this).attr("id", "transferring");
defineTabID($(`#transferring ~ [href^="${lang}/server/bump/"]`).attr("href").replace(RegExp(`${lang}/server/bump/`, "g"), ''));
window.location = window.location;
});
if (safetymode == true) {
var safety = Math.floor(Math.random() * 1801);
}
else {
safety = 0;
};
try {
var grabbedmin = Number($("[href='" + lang + "/server/bump/" + ID + "']").attr("data-remaining"));
}
catch(err) {
if (ID) {
Swal.fire(
'Hey!',
'Please select the server to be auto bumped.',
'error'
)
};
};
$("[href='" + lang + "/server/bump/" + ID + "'] span i:last-of-type").attr("class", "icon-robot");
$("[href='" + lang + "/server/bump/" + ID + "']").attr("id", "bumpme");
$("[href='" + lang + "/server/bump/" + ID + "']").removeAttr("disabled");
$("head").append(`<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">`);
$("head").append(`<style>
@keyframes rotate {
100% {
transform: rotate(1turn);
}
}
#bumpme {
position: relative;
z-index: 0;
border-radius: 10px;
overflow: hidden;
cursor: not-allowed !important;
}
#bumpme::before {
content: '';
position: absolute;
z-index: -2;
left: -150%;
top: -150%;
width: 400%;
height: 400%;
background-color: orange;
background-repeat: no-repeat;
background-size: 50% 50%, 50% 50%;
background-position: 0 0, 100% 0, 100% 100%, 0 100%;
background-image: linear-gradient(to left, orange, red 50%),linear-gradient(to right, orange, red 50%),linear-gradient(to right, orange, red 50%),linear-gradient(to left, orange, red 50%);
animation: rotate 4s linear infinite;
}
#bumpme::after {
content: '';
position: absolute;
z-index: -1;
left: 6px;
top: 6px;
width: calc(100% - 12px);
height: calc(100% - 12px);
background: white;
border-radius: 5px;
}
</style>`);
function bump() {
try {
$('#bumpme')[0].click();
console.log("Bumped! - " + ID);
}
catch(err) {
console.error("Bump failed... - " + ID + " - " + err);
};
};
String.prototype.toHHMMSS = function () {
if (isNaN(this)) return '--:--:--';
var sec_num = parseInt(this, 10);
var hours = Math.floor(sec_num / 3600);
var minutes = Math.floor((sec_num - (hours * 3600)) / 60);
var seconds = sec_num - (hours * 3600) - (minutes * 60);
if (hours < 10) {hours = "0"+hours;}
if (minutes < 10) {minutes = "0"+minutes;}
if (seconds < 10) {seconds = "0"+seconds;}
return hours+':'+minutes+':'+seconds;
}
function run(fn) {
if(typeof(Worker) !== "undefined") {
if(typeof(w) == "undefined") {
w = new Worker(URL.createObjectURL(new Blob(['('+fn+')()'])));
}
w.onmessage = function(event) {
var numberwow = event.data - safety;
var numberwoah = Number(grabbedmin) - numberwow;
document.getElementById("bumpcount").innerHTML = "Autobumper Enabled: " + numberwoah.toString().toHHMMSS();
if (isNaN(grabbedmin) && ID) {
bump()
w.terminate();
} else if (numberwow == grabbedmin) {
bump()
w.terminate();
} else if (isNaN(numberwoah)) {
bump()
w.terminate();
}
};
} else {
try {
Swal.fire(
'Hey!',
'Sorry, your browser does not support Disboard Auto Bump... (try downgrading to version 0.1).',
'error'
)
}
catch(err) {
alert("Sorry, your browser does not support Disboard Auto Bumper... (try downgrading to version 0.1)");
};
}
}
const worker = run(function() {
var i = 0;
function timedCount() {
i = i + 1;
postMessage(i);
setTimeout(function(){timedCount()},1000);
}
timedCount();
});
},3000);
});