From 62c1702315037a2307afd97173765df4d80318a1 Mon Sep 17 00:00:00 2001 From: Jimmy Vo Date: Fri, 14 Mar 2025 12:10:10 -0400 Subject: [PATCH] Fix conflicts --- ...ger-phishing-detection-script-injection.ts | 21 +++++++++++++++++++ .../services/phishing-detection.service.ts | 1 + 2 files changed, 22 insertions(+) create mode 100644 apps/browser/src/phishing-detection/trigger-phishing-detection-script-injection.ts diff --git a/apps/browser/src/phishing-detection/trigger-phishing-detection-script-injection.ts b/apps/browser/src/phishing-detection/trigger-phishing-detection-script-injection.ts new file mode 100644 index 00000000000..4312b3f304a --- /dev/null +++ b/apps/browser/src/phishing-detection/trigger-phishing-detection-script-injection.ts @@ -0,0 +1,21 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +/* eslint-disable no-console */ +// eslint-disable-next-line no-restricted-imports +import { PhishingDetectionService } from "src/platform/services/phishing-detection.service"; + +if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", loadPhishingDetectionContent); +} else { + void loadPhishingDetectionContent(); +} + +async function loadPhishingDetectionContent() { + // Found an issue with the internal PhishingDetectionService not being able to initialize properly. + // const activeUrl = await PhishingDetectionService.getActiveUrl(); + // const isPhishingDomain = PhishingDetectionService.checkUrl(activeUrl); + // if (isPhishingDomain) { + // PhishingDetectionService.notifyUser(activeUrl); + // } +} + +console.log("Phishing Detection Service loaded."); diff --git a/apps/browser/src/platform/services/phishing-detection.service.ts b/apps/browser/src/platform/services/phishing-detection.service.ts index 01bcb2d874a..d4f7ade0fbe 100644 --- a/apps/browser/src/platform/services/phishing-detection.service.ts +++ b/apps/browser/src/platform/services/phishing-detection.service.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import { Utils } from "@bitwarden/common/platform/misc/utils"; import { BrowserApi } from "../browser/browser-api";