-
⚠️ HTTP Content
-
This website uses HTTP and cannot be displayed in the frame for security reasons.
-
-
-
-
-
- `;
- document.body.appendChild(httpModal);
-
- // Handle button clicks
- const openBtn = httpModal.querySelector('.http-open-btn');
- const skipBtn = httpModal.querySelector('.http-skip-btn');
-
- openBtn.addEventListener('click', () => {
- console.log("Opening in new tab:", currentUrl); // Debug log
- window.open(currentUrl, '_blank');
- httpModal.remove();
- fumble();
- });
-
- skipBtn.addEventListener('click', () => {
- console.log("Skipping site"); // Debug log
- httpModal.remove();
- fumble();
- });
- return;
- }
-
- // Check for error pages
- const title = frame.contentWindow.document.title.toLowerCase();
- if (
- title.includes("blocked") ||
- title.includes("error") ||
- title.includes("refused") ||
- title.includes("cannot") ||
- title.includes("denied")
- ) {
-<<<<<<< HEAD
-<<<<<<< HEAD
-<<<<<<< HEAD
-=======
->>>>>>> parent of 97f3a78 (Reverted back to 4cd4110 before changes were made to monitoring. Trying)
- fumble();
- return;
- }
-
- frame.focus();
try {
- frame.contentWindow.focus();
+ const title = frame.contentWindow.document.title.toLowerCase();
+ if (
+ title.includes("blocked") ||
+ title.includes("error") ||
+ title.includes("refused") ||
+ title.includes("cannot") ||
+ title.includes("denied")
+ ) {
+ fumble();
+ return;
+ }
+
+ frame.focus();
+ try {
+ frame.contentWindow.focus();
+ } catch (e) {
+ // Ignore cross-origin errors
+ }
} catch (e) {
- // Ignore cross-origin errors
- }
- } catch (e) {
- console.log("Error in onload:", e); // Debug log
- // If we can't access the URL due to CORS, try using the src attribute
- if (frame.src.startsWith('http:')) {
- console.log("HTTP URL detected from src attribute"); // Debug log
- const httpUrl = frame.src;
- const httpModal = document.createElement('div');
- httpModal.className = 'modal http-modal show';
- httpModal.innerHTML = `
-
-
⚠️ HTTP Content
-
This website uses HTTP and cannot be displayed in the frame for security reasons.
-
-
-
-
-
- `;
- document.body.appendChild(httpModal);
-<<<<<<< HEAD
-=======
- // 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');
+ // Only show modal for mixed content errors
+ if (e.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();
+ };
+ return;
+ }
+ // For other errors, just try another site
fumble();
- };
-
- openBtn.onclick = () => {
- window.open(frame.src, '_blank');
- blockedModal.classList.remove('show');
- fumble();
- };
-=======
- // Try again if we hit an error page
- fumble();
->>>>>>> b6825be (Revert "Reverted back to 4cd4110 before changes were made to monitoring. Trying")
- return;
- }
- } catch (e) {
- // Can't access title due to CORS - assume page is OK
- }
->>>>>>> 495bda9 (Reverted back to 4cd4110 before changes were made to monitoring. Trying)
-=======
->>>>>>> parent of 97f3a78 (Reverted back to 4cd4110 before changes were made to monitoring. Trying)
-
- // Handle button clicks
- const openBtn = httpModal.querySelector('.http-open-btn');
- const skipBtn = httpModal.querySelector('.http-skip-btn');
-
- openBtn.addEventListener('click', () => {
- console.log("Opening in new tab:", httpUrl); // Debug log
- window.open(httpUrl, '_blank');
- httpModal.remove();
- fumble();
- });
-
- skipBtn.addEventListener('click', () => {
- console.log("Skipping site"); // Debug log
- httpModal.remove();
- fumble();
- });
- return;
}
};
- // Handle load errors
- frame.onerror = () => {
- fumble(); // Try again if loading fails
+ // 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
+ }
};
};
diff --git a/styles.css b/styles.css
index f9ce2bd..f0c6d28 100644
--- a/styles.css
+++ b/styles.css
@@ -909,20 +909,19 @@ main:hover .floating-button {
.full-license a:hover {
text-decoration: underline;
-<<<<<<< HEAD
}
-.http-modal .modal-content {
+.blocked-modal .modal-content {
max-width: 400px;
}
-.http-modal-buttons {
+.blocked-modal-buttons {
display: flex;
gap: 10px;
margin-top: 20px;
}
-.http-open-btn, .http-skip-btn {
+.blocked-retry-btn, .blocked-open-btn {
flex: 1;
padding: 12px;
border: none;
@@ -933,31 +932,33 @@ main:hover .floating-button {
transition: background-color 0.3s ease;
}
-.http-open-btn {
+.blocked-retry-btn {
background-color: #ff4500;
color: white;
}
-.dark-mode .http-open-btn {
+.dark-mode .blocked-retry-btn {
background-color: #ff6b4a;
}
-.http-open-btn:hover {
+.blocked-retry-btn:hover {
background-color: #ff5722;
}
-.http-skip-btn {
+.blocked-open-btn {
background-color: #f0f0f0;
color: #333;
}
-.dark-mode .http-skip-btn {
+.dark-mode .blocked-open-btn {
background-color: #2a2a2a;
color: #fff;
}
-.http-skip-btn:hover {
+.blocked-open-btn:hover {
background-color: #e0e0e0;
-=======
->>>>>>> b6825be (Revert "Reverted back to 4cd4110 before changes were made to monitoring. Trying")
-}
\ No newline at end of file
+}
+
+.dark-mode .blocked-open-btn:hover {
+ background-color: #333;
+}
\ No newline at end of file