mirror of
https://github.com/fmhy/FMHY-SafeGuard.git
synced 2026-03-11 08:55:40 +00:00
Add files via upload
This commit is contained in:
parent
6af36595f2
commit
1c92b3d62e
2 changed files with 241 additions and 0 deletions
211
platform/firefox/pub/warning-page.html
Normal file
211
platform/firefox/pub/warning-page.html
Normal file
|
|
@ -0,0 +1,211 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>FMHY SafeGuard - Warning</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<script src="warning-page.js"></script>
|
||||
<style>
|
||||
:root {
|
||||
--background: rgb(26, 26, 26);
|
||||
--text-primary: #e8e8e8;
|
||||
--text-secondary: #848a94;
|
||||
--accent-purple: #c4b5fd;
|
||||
--accent-blue: #7bc5e4;
|
||||
--danger: #ff4444;
|
||||
--card-bg: rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--background);
|
||||
font-family: "Inter", sans-serif;
|
||||
color: var(--text-primary);
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 2rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 600px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.warning-card {
|
||||
background: var(--card-bg);
|
||||
border-radius: 12px;
|
||||
padding: 2rem;
|
||||
margin: 2rem 0;
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: 0.5rem;
|
||||
background: linear-gradient(
|
||||
120deg,
|
||||
var(--accent-purple) 30%,
|
||||
var(--accent-blue)
|
||||
);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.warning-icon {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
margin: 1.5rem 0;
|
||||
animation: pulse 2s infinite;
|
||||
}
|
||||
|
||||
.url {
|
||||
color: var(--danger);
|
||||
font-weight: 500;
|
||||
margin-bottom: 1rem;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.warning-text {
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.buttons {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 0.75rem 1.5rem;
|
||||
border-radius: 8px;
|
||||
border: none;
|
||||
font-family: inherit;
|
||||
font-weight: 500;
|
||||
font-size: 1rem;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s, opacity 0.2s;
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.btn:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: linear-gradient(
|
||||
120deg,
|
||||
var(--accent-purple),
|
||||
var(--accent-blue)
|
||||
);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: transparent;
|
||||
border: 1px solid var(--text-secondary);
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 2rem;
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.footer a {
|
||||
color: var(--accent-blue);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.footer a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
}
|
||||
50% {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.buttons {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="title">FMHY SafeGuard</h1>
|
||||
<div class="warning-card">
|
||||
<img
|
||||
src="../res/icons/unsafe.png"
|
||||
alt="Warning"
|
||||
class="warning-icon"
|
||||
id="warningIcon"
|
||||
/>
|
||||
<p class="url" id="unsafeUrl"></p>
|
||||
<p class="warning-text">
|
||||
This site has been flagged as <strong>unsafe</strong>.<br />
|
||||
Be cautious when interacting with this site.
|
||||
</p>
|
||||
<div class="buttons">
|
||||
<button class="btn btn-secondary" id="goBack">
|
||||
Go Back (Recommended)
|
||||
</button>
|
||||
<button class="btn btn-primary" id="proceed">Proceed Anyway</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<p>
|
||||
Think this is a mistake?
|
||||
<a
|
||||
href="https://github.com/kenhendricks00/FMHY-SafeGuard/issues"
|
||||
target="_blank"
|
||||
>Let us know</a
|
||||
>
|
||||
</p>
|
||||
<p>
|
||||
Powered by
|
||||
<a href="https://github.com/fmhy/FMHYFilterlist" target="_blank"
|
||||
>FMHY Filterlist</a
|
||||
>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
30
platform/firefox/pub/warning-page.js
Normal file
30
platform/firefox/pub/warning-page.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const unsafeUrl = urlParams.get("url") || "unknown site";
|
||||
document.getElementById("unsafeUrl").textContent = unsafeUrl;
|
||||
console.log(`Warning page loaded for URL: ${unsafeUrl}`);
|
||||
|
||||
document.getElementById("goBack").addEventListener("click", () => {
|
||||
console.log("User clicked Go Back.");
|
||||
// Go back twice to skip over the warning page
|
||||
window.history.go(-2);
|
||||
});
|
||||
|
||||
document.getElementById("proceed").addEventListener("click", async () => {
|
||||
if (confirm("Are you sure you want to proceed? This site may be unsafe.")) {
|
||||
const [tab] = await browser.tabs.query({
|
||||
active: true,
|
||||
currentWindow: true,
|
||||
});
|
||||
|
||||
console.log(`Sending proceedAnyway message for tab ${tab.id}`);
|
||||
await browser.runtime.sendMessage({
|
||||
action: "proceedAnyway",
|
||||
tabId: tab.id,
|
||||
});
|
||||
|
||||
console.log("Proceed flag set, navigating to unsafe URL...");
|
||||
await browser.tabs.update(tab.id, { url: unsafeUrl });
|
||||
}
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue