mirror of
https://github.com/fmhy/FMHY-SafeGuard.git
synced 2026-03-11 08:55:40 +00:00
Update background.js
This commit is contained in:
parent
57341e1535
commit
2b273a31f5
1 changed files with 15 additions and 0 deletions
|
|
@ -195,6 +195,10 @@ function updatePageAction(status, tabId) {
|
|||
19: "../res/icons/fmhy_19.png",
|
||||
38: "../res/icons/fmhy_38.png",
|
||||
},
|
||||
extension_page: {
|
||||
19: "../res/ext_icon_144.png",
|
||||
38: "../res/ext_icon_144.png",
|
||||
},
|
||||
default: {
|
||||
19: "../res/icons/default_19.png",
|
||||
38: "../res/icons/default_38.png",
|
||||
|
|
@ -230,6 +234,17 @@ function checkSiteAndUpdatePageAction(tabId, url) {
|
|||
const normalizedUrl = normalizeUrl(url.trim());
|
||||
const rootUrl = extractRootUrl(normalizedUrl);
|
||||
|
||||
// Check if URL is an extension page
|
||||
const isExtensionPage =
|
||||
url.includes(browserAPI.runtime.getURL("pub/warning-page.html")) ||
|
||||
url.includes(browserAPI.runtime.getURL("pub/settings-page.html")) ||
|
||||
url.includes(browserAPI.runtime.getURL("pub/welcome-page.html"));
|
||||
|
||||
if (isExtensionPage) {
|
||||
updatePageAction("extension_page", tabId);
|
||||
return;
|
||||
}
|
||||
|
||||
const isUnsafe =
|
||||
unsafeSitesRegex?.test(rootUrl) || unsafeSitesRegex?.test(normalizedUrl);
|
||||
const isPotentiallyUnsafe =
|
||||
|
|
|
|||
Loading…
Reference in a new issue