-
Notifications
You must be signed in to change notification settings - Fork 125
Expand file tree
/
Copy pathroll.js
More file actions
64 lines (54 loc) · 1.83 KB
/
roll.js
File metadata and controls
64 lines (54 loc) · 1.83 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
;(function () {
console.log('DOMContentLoaded')
const containerId = 'div-gpt-ad-1744679821427-0'
const container = document.getElementById(containerId)
const key = '5ee99841a6801f0f3742958ab80c87bb'
const width = 728
const height = 90
if (!container) return
let injected = false
function injectAd() {
if (injected) return
injected = true
container.innerHTML = '' // Clear existing content (remove AdX banner if present)
container.style.width = `${width}px`
container.style.height = `${height}px`
const iframe = document.createElement('iframe')
iframe.width = width
iframe.height = height
iframe.frameBorder = '0'
iframe.scrolling = 'no'
iframe.style.border = 'none'
iframe.style.display = 'block'
iframe.style.margin = '0 auto'
iframe.style.padding = '0'
const srcdoc = `
<style>body { margin: 0; padding: 0; overflow: hidden; }</style>
<script type='text/javascript'>
atOptions = {
key: '${key}',
format: 'iframe',
height: ${height},
width: ${width},
params: {}
};
</script>
<script type='text/javascript' src='https://cutleryneighbouringpurpose.com/${key}/invoke.js'></script>`
iframe.srcdoc = srcdoc
container.appendChild(iframe)
}
// Check after 3 seconds
setTimeout(() => {
// Check if an iframe exists inside the container or if it's collapsed
const hasIframe = container.querySelector('iframe')
const isCollapsed = container.offsetHeight === 0
if (!hasIframe || isCollapsed) {
console.log('No ad iframe found or collapsed, injecting fallback...')
injectAd()
}
}, 3000)
// Force inject after 10 seconds
setTimeout(() => {
injectAd()
}, 10000)
})()