Reverted back to 4cd4110
before changes were made to monitoring. Trying
new implementation for failed pulls. Added modal for when content is blocked or fails to load
This commit is contained in:
parent
21327c81ea
commit
97f3a78f9d
2 changed files with 105 additions and 1 deletions
70
index.html
70
index.html
|
@ -191,6 +191,17 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="blockedModal" class="modal blocked-modal">
|
||||||
|
<div class="modal-content">
|
||||||
|
<h2>⚠️ Content Blocked</h2>
|
||||||
|
<p>This content cannot be displayed due to security restrictions.</p>
|
||||||
|
<div class="blocked-modal-buttons">
|
||||||
|
<button id="blockedRetryBtn" class="blocked-retry-btn">Try Another Site</button>
|
||||||
|
<button id="blockedOpenBtn" class="blocked-open-btn">Open in New Tab</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<iframe
|
<iframe
|
||||||
id="contentFrame"
|
id="contentFrame"
|
||||||
|
@ -306,6 +317,7 @@
|
||||||
title.includes("cannot") ||
|
title.includes("cannot") ||
|
||||||
title.includes("denied")
|
title.includes("denied")
|
||||||
) {
|
) {
|
||||||
|
<<<<<<< HEAD
|
||||||
fumble();
|
fumble();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -335,6 +347,47 @@
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
document.body.appendChild(httpModal);
|
document.body.appendChild(httpModal);
|
||||||
|
=======
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
|
>>>>>>> 495bda9 (Reverted back to 4cd4110 before changes were made to monitoring. Trying)
|
||||||
|
|
||||||
// Handle button clicks
|
// Handle button clicks
|
||||||
const openBtn = httpModal.querySelector('.http-open-btn');
|
const openBtn = httpModal.querySelector('.http-open-btn');
|
||||||
|
@ -358,7 +411,22 @@
|
||||||
|
|
||||||
// Handle load errors
|
// Handle load errors
|
||||||
frame.onerror = () => {
|
frame.onerror = () => {
|
||||||
fumble(); // Try again if loading fails
|
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();
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
36
styles.css
36
styles.css
|
@ -911,17 +911,29 @@ main:hover .floating-button {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
.http-modal .modal-content {
|
.http-modal .modal-content {
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.http-modal-buttons {
|
.http-modal-buttons {
|
||||||
|
=======
|
||||||
|
.blocked-modal .modal-content {
|
||||||
|
max-width: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blocked-modal-buttons {
|
||||||
|
>>>>>>> 495bda9 (Reverted back to 4cd4110 before changes were made to monitoring. Trying)
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
.http-open-btn, .http-skip-btn {
|
.http-open-btn, .http-skip-btn {
|
||||||
|
=======
|
||||||
|
.blocked-retry-btn, .blocked-open-btn {
|
||||||
|
>>>>>>> 495bda9 (Reverted back to 4cd4110 before changes were made to monitoring. Trying)
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
border: none;
|
border: none;
|
||||||
|
@ -932,11 +944,16 @@ main:hover .floating-button {
|
||||||
transition: background-color 0.3s ease;
|
transition: background-color 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
.http-open-btn {
|
.http-open-btn {
|
||||||
|
=======
|
||||||
|
.blocked-retry-btn {
|
||||||
|
>>>>>>> 495bda9 (Reverted back to 4cd4110 before changes were made to monitoring. Trying)
|
||||||
background-color: #ff4500;
|
background-color: #ff4500;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
.dark-mode .http-open-btn {
|
.dark-mode .http-open-btn {
|
||||||
background-color: #ff6b4a;
|
background-color: #ff6b4a;
|
||||||
}
|
}
|
||||||
|
@ -946,15 +963,34 @@ main:hover .floating-button {
|
||||||
}
|
}
|
||||||
|
|
||||||
.http-skip-btn {
|
.http-skip-btn {
|
||||||
|
=======
|
||||||
|
.dark-mode .blocked-retry-btn {
|
||||||
|
background-color: #ff6b4a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blocked-retry-btn:hover {
|
||||||
|
background-color: #ff5722;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blocked-open-btn {
|
||||||
|
>>>>>>> 495bda9 (Reverted back to 4cd4110 before changes were made to monitoring. Trying)
|
||||||
background-color: #f0f0f0;
|
background-color: #f0f0f0;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
.dark-mode .http-skip-btn {
|
.dark-mode .http-skip-btn {
|
||||||
|
=======
|
||||||
|
.dark-mode .blocked-open-btn {
|
||||||
|
>>>>>>> 495bda9 (Reverted back to 4cd4110 before changes were made to monitoring. Trying)
|
||||||
background-color: #2a2a2a;
|
background-color: #2a2a2a;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
.http-skip-btn:hover {
|
.http-skip-btn:hover {
|
||||||
|
=======
|
||||||
|
.blocked-open-btn:hover {
|
||||||
|
>>>>>>> 495bda9 (Reverted back to 4cd4110 before changes were made to monitoring. Trying)
|
||||||
background-color: #e0e0e0;
|
background-color: #e0e0e0;
|
||||||
}
|
}
|
Loading…
Reference in a new issue