Skip to content

Commit 8d99f12

Browse files
committed
add crowdNavigate helper function
1 parent 5788d6e commit 8d99f12

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/bypasses/tii.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ export default class TiiLa extends BypassDefinition {
99
execute() {
1010
const urlObj = new URL(window.location.href)
1111
this.helpers.crowdQuery('tii.la', urlObj.pathname.slice(1)).then((dest) => {
12-
this.helpers.crowdNavigate(dest);
12+
this.helpers.crowdNavigate(dest)
1313
});
1414
/*keep checking for the button*/
15-
setInterval(() => {
15+
setInterval(() => {
1616
const button = document.querySelector("a.btn.btn-success.btn-lg.get-link");
17-
if (button.href) {
17+
if (button && button.href) {
1818
this.helpers.crowdContribute('tii.la', urlObj.pathname.slice(1), button.href)
1919
this.helpers.safelyNavigate(button.href)
2020
}

src/helpers/dom.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export function crowdQuery(domain, path) {
247247
return new Promise((resolve, reject) => {
248248
const timeout = setTimeout(() => {
249249
reject(new Error('Timeout: crowd response not received'));
250-
}, 5000); //5 sec timeout
250+
}, 10000); //10 sec timeout
251251

252252
document.addEventListener('ff53054c0e13_crowdResponse', function (event) {
253253
clearTimeout(timeout);
@@ -443,6 +443,13 @@ export async function bypassRequests(execution_method) {
443443
return Promise.resolve(result);
444444
};
445445
}
446+
/**
447+
* Navigates to the specified URL. To be used for crowd sourced bypasses.
448+
* @param {string} target - The target URL to navigate to.
449+
*/
450+
export function crowdNavigate(target) {
451+
unsafelyNavigate(target, null, true);
452+
}
446453

447454
export default {
448455
insertInfoBox,
@@ -451,6 +458,7 @@ export default {
451458
ffclipboard,
452459
crowdQuery,
453460
crowdContribute,
461+
crowdNavigate,
454462
followAndContribute,
455463
unsafelyNavigate,
456464
parseTarget,

0 commit comments

Comments
 (0)