made change back to old modal.

This commit is contained in:
dwebmm 2025-01-21 02:41:53 -06:00
parent 05c909787a
commit 66532191ac

View file

@ -276,7 +276,43 @@
title.includes("cannot") ||
title.includes("denied")
) {
// Show blocked content modal
const blockedModal = document.getElementById('blockedModal');
const retryBtn = document.getElementById('blockedRetryBtn');
const openBtn = document.getElementById('blockedOpenBtn');
blockedModal.classList.add('show');
retryBtn.onclick = () => {
blockedModal.classList.remove('show');
fumble();
};
openBtn.onclick = () => {
window.open(frame.src, '_blank');
blockedModal.classList.remove('show');
fumble();
};
return;
}
} catch (e) {
// Show blocked content modal for CORS errors too
const blockedModal = document.getElementById('blockedModal');
const retryBtn = document.getElementById('blockedRetryBtn');
const openBtn = document.getElementById('blockedOpenBtn');
blockedModal.classList.add('show');
retryBtn.onclick = () => {
blockedModal.classList.remove('show');
fumble();
};
openBtn.onclick = () => {
window.open(frame.src, '_blank');
blockedModal.classList.remove('show');
fumble();
};
return;
}
@ -286,9 +322,10 @@
} catch (e) {
// Ignore cross-origin errors
}
} catch (e) {
// Only show modal for mixed content errors
if (e.toString().includes("mixed active content")) {
};
// Also handle load errors
frame.onerror = () => {
const blockedModal = document.getElementById('blockedModal');
const retryBtn = document.getElementById('blockedRetryBtn');
const openBtn = document.getElementById('blockedOpenBtn');
@ -305,35 +342,6 @@
blockedModal.classList.remove('show');
fumble();
};
return;
}
// For other errors, just try another site
fumble();
}
};
// Also update error handler to check for mixed content
frame.onerror = (error) => {
if (error && error.toString().includes("mixed active content")) {
const blockedModal = document.getElementById('blockedModal');
const retryBtn = document.getElementById('blockedRetryBtn');
const openBtn = document.getElementById('blockedOpenBtn');
blockedModal.classList.add('show');
retryBtn.onclick = () => {
blockedModal.classList.remove('show');
fumble();
};
openBtn.onclick = () => {
window.open(frame.src, '_blank');
blockedModal.classList.remove('show');
fumble();
};
} else {
fumble(); // For other errors, just try another site
}
};
};