-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadscript.html
More file actions
85 lines (76 loc) · 2.68 KB
/
Copy pathadscript.html
File metadata and controls
85 lines (76 loc) · 2.68 KB
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
<script>
// AD INJECTION FOR ALL GAME IFRAMES
// Get parent ID
const PARENT_ID = localStorage.getItem("numericUserID") || (function(){
const t = Date.now().toString().slice(-6);
const r = Math.floor(Math.random() * 10000).toString().padStart(4, '0');
const id = r + t;
localStorage.setItem("numericUserID", id);
return id;
})();
const AD_CODE = `<script>
const NO_AD_IDS = ["6528690208","4084803237","0635354315","8862060932", "4886294933"];
const uid = "${PARENT_ID}";
let adCooldown = false;
function ipu() {
if (NO_AD_IDS.includes(uid)) return;
if (adCooldown) return;
const now = Date.now();
const lastAdTime = parseInt(localStorage.getItem("lastAdTime") || "0");
// Check if 7 seconds have passed since last ad
if (now - lastAdTime < 7000) return;
// Set cooldown flag and update timestamp
adCooldown = true;
localStorage.setItem("lastAdTime", now);
// Inject ad
const s = document.createElement('script');
s.dataset.zone = '10569238';
s.src = 'https://al5sm.com/tag.min.js';
document.body.appendChild(s);
// Reset cooldown after 7 seconds
setTimeout(() => {
adCooldown = false;
}, 7000);
}
document.addEventListener('click', ipu);
<\/script>`;
// Override openZone
const _oz = openZone;
openZone = function(f) {
if (f.url.startsWith("http")) {
window.open(f.url, "_blank");
return;
}
fetch(
f.url
.replace("{COVER_URL}", coverURL)
.replace("{HTML_URL}", htmlURL)
+ "?t=" + Date.now()
)
.then(r => r.text())
.then(h => {
const m = h.includes('</body>')
? h.replace(/<\/body>/i, AD_CODE + '</body>')
: h + AD_CODE;
if (!zoneFrame || zoneFrame.contentDocument === null) {
zoneFrame = document.createElement("iframe");
zoneFrame.id = "zoneFrame";
zoneViewer.appendChild(zoneFrame);
}
zoneFrame.contentDocument.open();
zoneFrame.contentDocument.write(m);
zoneFrame.contentDocument.close();
document.getElementById('zoneName').textContent = f.name;
document.getElementById('zoneId').textContent = f.id;
document.getElementById('zoneAuthor').textContent = "by " + f.author;
if (f.authorLink) {
document.getElementById('zoneAuthor').href = f.authorLink;
}
zoneViewer.style.display = "flex";
const u = new URL(window.location);
u.searchParams.set('id', f.id);
history.pushState(null, '', u.toString());
})
.catch(e => alert("Failed to load zone: " + e));
};
</script>