Skip to content

Commit

Permalink
Properly check the value for the bypass (#552)
Browse files Browse the repository at this point in the history
  • Loading branch information
xbubbo committed Mar 22, 2024
1 parent 7404114 commit a44eedb
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 35 deletions.
80 changes: 49 additions & 31 deletions static/assets/scripts/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@ function iframeLoad() {
const website = iframe.contentWindow?.location.href.replace(window.location.origin, '').replace('/a/', '')
document.getElementById('is').value = decodeXor(website)
localStorage.setItem('decoded', decodeXor(website));
window.parent.postMessage({ decodedSet: true }, '*');
} else if (website.includes('/a/q/')) {
const website = iframe.contentWindow?.location.href.replace(window.location.origin, '').replace('/a/q/', '')
document.getElementById('is').value = decodeXor(website)
localStorage.setItem('decoded', decodeXor(website));
window.parent.postMessage({ decodedSet: true }, '*');
}
}
}


// Reload
function reload() {
if (iframe) {
Expand Down Expand Up @@ -141,43 +144,58 @@ document.addEventListener('fullscreenchange', function () {
// Now
const key = ['nowgg', 'now.gg'];
const decoded = localStorage.getItem('decoded');
let decodedSet = false;

window.addEventListener('message', function(event) {
if (event.data && event.data.decodedSet === true) {
decodedSet = true;
console.log('Starting process.');
now();
}
});

if (decoded) {
function now() {
if (decoded) {
let found = false;
for (const keyword of key) {
if (decoded.includes(keyword)) {
console.log(`${keyword} found`);
found = true;
break;
}
if (decoded.includes(keyword)) {
console.log(`${keyword} found`);
found = true;
break;
}
}
if (found) {
let count = 0;
let notfound = 0;
const limit = 10;
const max = 35;
const reloadInterval = setInterval(() => {
if (count < limit && iframe) {
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
const element = iframeDocument.querySelector('.sc-hGPBjI.gGkQpt');
if (element) {
console.log("Unsafe proxy or VPN detected. Reloading...");
iframe.contentWindow.location.reload();
count++;
notfound = 0;
} else {
console.log("Class not found inside the iframe.");
notfound++;
if (notfound >= max) {
console.log(`Class not found for ${max} consecutive checks. Stopping.`);
clearInterval(reloadInterval);
}
}
} else {
clearInterval(reloadInterval);
let count = 0;
let notfound = 0;
const limit = 10;
const max = 35;
const reloadInterval = setInterval(() => {
if (count < limit && iframe) {
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
const element = iframeDocument.querySelector('.sc-hGPBjI.gGkQpt');
if (element) {
console.log("Unsafe proxy or VPN detected. Reloading...");
iframe.contentWindow.location.reload();
count += 1;
notfound = 0;
} else {
console.log("Class not found inside the iframe.");
notfound += 1;
if (notfound >= max) {
console.log(`Class not found for ${max} consecutive checks. Stopping.`);
clearInterval(reloadInterval);
}
}, 500);
}
} else {
clearInterval(reloadInterval);
}
}, 500);
}
} else {
} else {
console.log('Decoded not found in localStorage.');
}
}

if (decodedSet) {
now();
}
6 changes: 2 additions & 4 deletions static/go.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@
height="100%"
width="100%"
allowfullscreen
sandbox="allow-scripts allow-same-origin">
></iframe
>
sandbox="allow-forms allow-scripts allow-same-origin"></iframe>
<script src="assets/scripts/index.js?v=9"></script>
<script src="assets/scripts/frame.js?v=20"></script>
<script src="assets/scripts/frame.js?v=22"></script>
<script src="./m/bundle.js?v=4"></script>
<script src="./m/config.js?v=3"></script>
<script src="https://kit.fontawesome.com/1237c86ba0.js" crossorigin="anonymous"></script>
Expand Down

0 comments on commit a44eedb

Please sign in to comment.