Update challenge.js to try/catch each attempt at clearing subdomain cookies to ignore "rejected for domain" errors

This commit is contained in:
Thomas Lynch
2025-01-25 10:12:00 +11:00
parent 2011f60377
commit 63a6933aa4
2 changed files with 6 additions and 4 deletions

View File

@ -80,9 +80,11 @@ const wasmSupported = (() => {
function clearCookiesForDomains(domain) {
const parts = ['www', ...domain.split('.')];
for (let i = 0; i < parts.length - 1; i++) {
const subdomain = parts.slice(i).join('.');
document.cookie = `_basedflare_pow=; Max-Age=-9999999; Path=/; Domain=.${subdomain}`;
document.cookie = `_basedflare_captcha=; Max-Age=-9999999; Path=/; Domain=.${subdomain}`;
try {
const subdomain = parts.slice(i).join('.');
document.cookie = `_basedflare_pow=; Max-Age=-9999999; Path=/; Domain=.${subdomain}`;
document.cookie = `_basedflare_captcha=; Max-Age=-9999999; Path=/; Domain=.${subdomain}`;
} catch { /* ignore "rejected for domain" errors in FF, but continue the loop and try each subdomain anyway. */ }
}
location.reload();
}

File diff suppressed because one or more lines are too long