Skip to content

Commit a44eedb

Browse files
committed
Properly check the value for the bypass (#552)
1 parent 7404114 commit a44eedb

File tree

2 files changed

+51
-35
lines changed

2 files changed

+51
-35
lines changed

static/assets/scripts/frame.js

+49-31
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ function iframeLoad() {
2222
const website = iframe.contentWindow?.location.href.replace(window.location.origin, '').replace('/a/', '')
2323
document.getElementById('is').value = decodeXor(website)
2424
localStorage.setItem('decoded', decodeXor(website));
25+
window.parent.postMessage({ decodedSet: true }, '*');
2526
} else if (website.includes('/a/q/')) {
2627
const website = iframe.contentWindow?.location.href.replace(window.location.origin, '').replace('/a/q/', '')
2728
document.getElementById('is').value = decodeXor(website)
2829
localStorage.setItem('decoded', decodeXor(website));
30+
window.parent.postMessage({ decodedSet: true }, '*');
2931
}
3032
}
3133
}
3234

35+
3336
// Reload
3437
function reload() {
3538
if (iframe) {
@@ -141,43 +144,58 @@ document.addEventListener('fullscreenchange', function () {
141144
// Now
142145
const key = ['nowgg', 'now.gg'];
143146
const decoded = localStorage.getItem('decoded');
147+
let decodedSet = false;
148+
149+
window.addEventListener('message', function(event) {
150+
if (event.data && event.data.decodedSet === true) {
151+
decodedSet = true;
152+
console.log('Starting process.');
153+
now();
154+
}
155+
});
144156

145-
if (decoded) {
157+
function now() {
158+
if (decoded) {
146159
let found = false;
147160
for (const keyword of key) {
148-
if (decoded.includes(keyword)) {
149-
console.log(`${keyword} found`);
150-
found = true;
151-
break;
152-
}
161+
if (decoded.includes(keyword)) {
162+
console.log(`${keyword} found`);
163+
found = true;
164+
break;
165+
}
153166
}
154167
if (found) {
155-
let count = 0;
156-
let notfound = 0;
157-
const limit = 10;
158-
const max = 35;
159-
const reloadInterval = setInterval(() => {
160-
if (count < limit && iframe) {
161-
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
162-
const element = iframeDocument.querySelector('.sc-hGPBjI.gGkQpt');
163-
if (element) {
164-
console.log("Unsafe proxy or VPN detected. Reloading...");
165-
iframe.contentWindow.location.reload();
166-
count++;
167-
notfound = 0;
168-
} else {
169-
console.log("Class not found inside the iframe.");
170-
notfound++;
171-
if (notfound >= max) {
172-
console.log(`Class not found for ${max} consecutive checks. Stopping.`);
173-
clearInterval(reloadInterval);
174-
}
175-
}
176-
} else {
177-
clearInterval(reloadInterval);
168+
let count = 0;
169+
let notfound = 0;
170+
const limit = 10;
171+
const max = 35;
172+
const reloadInterval = setInterval(() => {
173+
if (count < limit && iframe) {
174+
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
175+
const element = iframeDocument.querySelector('.sc-hGPBjI.gGkQpt');
176+
if (element) {
177+
console.log("Unsafe proxy or VPN detected. Reloading...");
178+
iframe.contentWindow.location.reload();
179+
count += 1;
180+
notfound = 0;
181+
} else {
182+
console.log("Class not found inside the iframe.");
183+
notfound += 1;
184+
if (notfound >= max) {
185+
console.log(`Class not found for ${max} consecutive checks. Stopping.`);
186+
clearInterval(reloadInterval);
178187
}
179-
}, 500);
188+
}
189+
} else {
190+
clearInterval(reloadInterval);
191+
}
192+
}, 500);
180193
}
181-
} else {
194+
} else {
182195
console.log('Decoded not found in localStorage.');
196+
}
197+
}
198+
199+
if (decodedSet) {
200+
now();
183201
}

static/go.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,9 @@
5656
height="100%"
5757
width="100%"
5858
allowfullscreen
59-
sandbox="allow-scripts allow-same-origin">
60-
></iframe
61-
>
59+
sandbox="allow-forms allow-scripts allow-same-origin"></iframe>
6260
<script src="assets/scripts/index.js?v=9"></script>
63-
<script src="assets/scripts/frame.js?v=20"></script>
61+
<script src="assets/scripts/frame.js?v=22"></script>
6462
<script src="./m/bundle.js?v=4"></script>
6563
<script src="./m/config.js?v=3"></script>
6664
<script src="https://kit.fontawesome.com/1237c86ba0.js" crossorigin="anonymous"></script>

0 commit comments

Comments
 (0)