From 6af36595f23fff3b87e8856a8a5f2558f3d5e40a Mon Sep 17 00:00:00 2001
From: Kenneth Hendricks <50819541+kenhendricks00@users.noreply.github.com>
Date: Sat, 2 Nov 2024 21:29:01 -0400
Subject: [PATCH] Add files via upload
---
platform/chromium/pub/warning-page.html | 211 ++++++++++++++++++++++++
platform/chromium/pub/warning-page.js | 31 ++++
2 files changed, 242 insertions(+)
create mode 100644 platform/chromium/pub/warning-page.html
create mode 100644 platform/chromium/pub/warning-page.js
diff --git a/platform/chromium/pub/warning-page.html b/platform/chromium/pub/warning-page.html
new file mode 100644
index 0000000..dc8590e
--- /dev/null
+++ b/platform/chromium/pub/warning-page.html
@@ -0,0 +1,211 @@
+
+
+
+
+
+ FMHY SafeGuard - Warning
+
+
+
+
+
+
+
+
+
FMHY SafeGuard
+
+

+
+
+ This site has been flagged as unsafe.
+ Be cautious when interacting with this site.
+
+
+
+
+
+
+
+
+
+
diff --git a/platform/chromium/pub/warning-page.js b/platform/chromium/pub/warning-page.js
new file mode 100644
index 0000000..c90ec7a
--- /dev/null
+++ b/platform/chromium/pub/warning-page.js
@@ -0,0 +1,31 @@
+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.");
+ window.history.go(-2);
+ });
+
+ document.getElementById("proceed").addEventListener("click", () => {
+ if (confirm("Are you sure you want to proceed? This site may be unsafe.")) {
+ chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
+ const tab = tabs[0];
+
+ console.log(`Sending proceedAnyway message for tab ${tab.id}`);
+ chrome.runtime.sendMessage(
+ {
+ action: "proceedAnyway",
+ tabId: tab.id,
+ },
+ () => {
+ console.log("Proceed flag set, navigating to unsafe URL...");
+ chrome.tabs.update(tab.id, { url: unsafeUrl });
+ }
+ );
+ });
+ }
+ });
+});