Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detection for chrome browser pages #17

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/pub/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,15 @@ document.addEventListener("DOMContentLoaded", async () => {
handleStatusUpdate("extension_page", currentUrl);
return; // Skip further processing since it's an internal page
}


// Check if the URL is a chrome page
if (
currentUrl.startsWith("chrome://")
) {
handleStatusUpdate("chrome_page", currentUrl);
return; // Skip further processing since it's an internal page
}

// Send a message to the background script to check the site's status
const response = await browserAPI.runtime.sendMessage({
action: "checkSiteStatus",
Expand Down Expand Up @@ -112,6 +120,9 @@ document.addEventListener("DOMContentLoaded", async () => {
case "no_data":
message = `No data available for <strong>${displayUrl}</strong>.`;
break;
case "chrome_page":
message =
"You are on a <strong>chrome page</strong>. This page is managed by your browser.";
default:
message = `An unknown status was received for <strong>${displayUrl}</strong>.`;
}
Expand All @@ -132,6 +143,7 @@ document.addEventListener("DOMContentLoaded", async () => {
safe: "../res/icons/safe.png",
starred: "../res/icons/starred.png",
extension_page: "../res/ext_icon_144.png",
chrome_page: "../res/ext_icon_144.png",
no_data: "../res/ext_icon_144.png",
error: "../res/icons/error.png",
unknown: "../res/ext_icon_144.png",
Expand Down