This repository has been archived by the owner on Nov 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackground.js
38 lines (37 loc) · 1.62 KB
/
background.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
console.log("🕗 Loading Cheat Extension");
console.log("🛑 Blocking GeoGuessr Anti-Cheat");
(async () => {
setInterval(() => {
let url = window.location.href;
let lastUrl = document.referrer;
console.log(url, lastUrl);
if (url != lastUrl && url.includes("/games")) {
window.location.reload();
}
}, 1000)
// Injection du JavaScript dans la page Web
runTimeId = `GeoGuessr-${Math.floor(Math.random()*10*1000)}`;
let s = document.createElement('script');
s.id = runTimeId;
s.src = chrome.extension.getURL('script.js');
(document.head || document.documentElement).appendChild(s);
// let scripts = document.getElementsByTagName("script");
// for (var i = 0; i < scripts.length; i++) {
// if (scripts[i].id == runTimeId) {
// console.log(scripts[i]);
// }
// }
let gameStatuesContainer = document.getElementsByClassName('game-statuses');
let id = Math.floor(Math.random() * 9 * 1000 * 9 * 1000);
let gameStatus = document.createElement("div");
gameStatus.id = `GeoGuessrCheat-${id}`;
gameStatus.classList.add("game-status");
gameStatus.innerHTML += `
<div class="game-status__heading">Start Cheat</div>
<div class="game-status__body">
<button onclick="x();" style="cursor:pointer;text-decoration:none;outline:none;transition:.3s;border: none;background: white;color: black;font-weight: 900;" id="btnCheatEvent">Start</button>
</div>
`;
gameStatuesContainer[0].appendChild(gameStatus)
console.log("✅ Successfully loaded!");
})()