diff --git a/index.html b/index.html index 4735032..6d14970 100644 --- a/index.html +++ b/index.html @@ -256,22 +256,55 @@ // Wait for the page to load then focus frame.onload = () => { - // Check if we landed on a blocked/error page try { + // Check if it's an HTTP URL + if (frame.src.startsWith('http:')) { + const httpModal = document.createElement('div'); + httpModal.className = 'modal http-modal show'; + httpModal.innerHTML = ` +
+ `; + document.body.appendChild(httpModal); + + // Handle button clicks + httpModal.querySelector('.http-open-btn').addEventListener('click', () => { + window.open(frame.src, '_blank'); + httpModal.remove(); + fumble(); // Load next site + }); + + httpModal.querySelector('.http-skip-btn').addEventListener('click', () => { + httpModal.remove(); + fumble(); // Skip to next site + }); + return; + } + + // Rest of existing onload code... const title = frame.contentWindow.document.title.toLowerCase(); if ( - title.includes("blocked") || - title.includes("error") || - title.includes("refused") || - title.includes("cannot") || - title.includes("denied") + title.includes("blocked") || + title.includes("error") || + title.includes("refused") || + title.includes("cannot") || + title.includes("denied") ) { - // Try again if we hit an error page - fumble(); - return; + fumble(); + return; } } catch (e) { - // Can't access title due to CORS - assume page is OK + // Can't access title due to CORS - check if it's HTTP + if (frame.src.startsWith('http:')) { + fumble(); // Skip HTTP sites that we can't access + return; + } } frame.focus(); diff --git a/styles.css b/styles.css index d799910..f7dee24 100644 --- a/styles.css +++ b/styles.css @@ -909,4 +909,52 @@ main:hover .floating-button { .full-license a:hover { text-decoration: underline; +} + +.http-modal .modal-content { + max-width: 400px; +} + +.http-modal-buttons { + display: flex; + gap: 10px; + margin-top: 20px; +} + +.http-open-btn, .http-skip-btn { + flex: 1; + padding: 12px; + border: none; + border-radius: 8px; + font-size: 16px; + font-weight: bold; + cursor: pointer; + transition: background-color 0.3s ease; +} + +.http-open-btn { + background-color: #ff4500; + color: white; +} + +.dark-mode .http-open-btn { + background-color: #ff6b4a; +} + +.http-open-btn:hover { + background-color: #ff5722; +} + +.http-skip-btn { + background-color: #f0f0f0; + color: #333; +} + +.dark-mode .http-skip-btn { + background-color: #2a2a2a; + color: #fff; +} + +.http-skip-btn:hover { + background-color: #e0e0e0; } \ No newline at end of file