mirror of
https://github.com/fmhy/FMHY-SafeGuard.git
synced 2026-03-11 08:55:40 +00:00
Update warning-page.js
This commit is contained in:
parent
b3e30db0e6
commit
30259fb63d
1 changed files with 10 additions and 5 deletions
|
|
@ -27,16 +27,21 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
`Sending approveSite message for tab ${currentTab.id} and URL ${unsafeUrl}`
|
||||
);
|
||||
|
||||
// Send approval message to the background script
|
||||
await browserAPI.runtime.sendMessage({
|
||||
// Approve the site and wait for confirmation from the background script
|
||||
const response = await browserAPI.runtime.sendMessage({
|
||||
action: "approveSite",
|
||||
tabId: currentTab.id,
|
||||
url: unsafeUrl,
|
||||
});
|
||||
|
||||
console.log("Approval stored, navigating to the unsafe URL...");
|
||||
// Redirect to the approved unsafe URL
|
||||
await browserAPI.tabs.update(currentTab.id, { url: unsafeUrl });
|
||||
if (response && response.status === "approved") {
|
||||
console.log("Approval confirmed, navigating to the unsafe URL...");
|
||||
|
||||
// Redirect to the approved unsafe URL
|
||||
await browserAPI.tabs.update(currentTab.id, { url: unsafeUrl });
|
||||
} else {
|
||||
console.error("Approval failed or no response from background.");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue