Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mamayaya1
GitHub Repository: mamayaya1/game
Path: blob/main/js/main.js
4626 views
1
// Hello there!
2
//
3
// If you want to add my games to your site, please reach out at my email: [email protected], or discord: 3kh0_#1791
4
5
console.warn(
6
"%cNote!",
7
"color: purple; font-weight: 600; background: yellow; padding: 0 5px; border-radius: 5px",
8
"This script mostly helps all of the games run, DO NOT REMOVE IT! If you want to add my games to your site, please reach out at my email: [email protected]\nDo not just add them without asking me first!"
9
);
10
function log(text) {
11
console.log("%cSite script", "color: red; font-weight: 600; background: black; padding: 0 5px; border-radius: 5px", text);
12
}
13
function tab(text) {
14
console.log("%cTab Cloak", "color: green; font-weight: 600; background: black; padding: 0 5px; border-radius: 5px", text);
15
}
16
function script(text) {
17
console.log("%cScript Injection", "color: cyan; font-weight: 600; background: black; padding: 0 5px; border-radius: 5px", text);
18
}
19
// ====================================
20
// TAB CLOAK
21
// ====================================
22
23
tab("Loading Tab Cloak...");
24
//Declare variables for cloak here
25
const local_title = localStorage.getItem("title");
26
const local_icon = localStorage.getItem("icon");
27
28
// Set tab title (if needed)
29
if (window.localStorage.hasOwnProperty("title")) {
30
document.title = local_title;
31
tab("Title set to: " + local_title);
32
} else {
33
tab("Title not set :(");
34
}
35
// Set tab icon (if needed)
36
if (window.localStorage.hasOwnProperty("icon")) {
37
document.querySelector("link[rel=icon]").href = local_icon;
38
tab("Icon set to: " + local_icon);
39
} else {
40
tab("Icon not set :(");
41
}
42
tab("Tab cloak settings can be found in localStorage! If you want to change them, you can go tab cloak page.");
43
44
// ====================================
45
// SCRIPT INJECTION
46
// ====================================
47
48
script("Preparing 2 scripts to be injected...");
49
50
const gascript = document.createElement("script");
51
gascript.setAttribute("async", "");
52
gascript.setAttribute("src", "https://www.googletagmanager.com/gtag/js?id=G-98DP5VKS42");
53
const inlinegascript = document.createElement("script");
54
inlinegascript.innerHTML = `window.dataLayer = window.dataLayer || [];
55
function gtag(){dataLayer.push(arguments);}
56
gtag('js', new Date());
57
gtag('config', 'G-98DP5VKS42');`;
58
document.head.append(gascript, inlinegascript);
59
script("Injected script 1/2");
60
61
const dmca = document.createElement("img");
62
dmca.setAttribute("src", "https://images.dmca.com/Badges/dmca_protected_sml_120n.png?ID=b58222e2-70c9-4ade-b53a-ef9a7b5ea03b");
63
dmca.setAttribute("style", "display: none;")
64
const dmcaS = document.createElement("script");
65
dmcaS.setAttribute("src", "https://images.dmca.com/Badges/DMCABadgeHelper.min.js");
66
script("Injected script 2/2");
67
68
log("Script injections finished!");
69
70
log("All done!");
71