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,19 +276,7 @@
title.includes("cannot") ||
title.includes("denied")
) {
fumble();
return;
}
frame.focus();
try {
frame.contentWindow.focus();
} catch (e) {
// Ignore cross-origin errors
}
} catch (e) {
// Only show modal for mixed content errors
if (e.toString().includes("mixed active content")) {
// Show blocked content modal
const blockedModal = document.getElementById('blockedModal');
const retryBtn = document.getElementById('blockedRetryBtn');
const openBtn = document.getElementById('blockedOpenBtn');
@ -307,14 +295,8 @@
};
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")) {
} 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');
@ -331,9 +313,35 @@
blockedModal.classList.remove('show');
fumble();
};
} else {
fumble(); // For other errors, just try another site
return;
}
frame.focus();
try {
frame.contentWindow.focus();
} catch (e) {
// Ignore cross-origin errors
}
};
// Also handle load errors
frame.onerror = () => {
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();
};
};
};