mirror of
https://gitgud.io/fatchan/haproxy-protection.git
synced 2025-05-09 02:05:37 +00:00
Update challenge.js to try/catch each attempt at clearing subdomain cookies to ignore "rejected for domain" errors
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
2
src/js/challenge.min.js
vendored
2
src/js/challenge.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user