Skip to content

Commit 78f4947

Browse files
Banrionclaude[bot]
andauthored
[PM-25884] Disable phishing detection if safari is detected (bitwarden#17655)
* Disable phishing detection if safari is detected * Apply suggestion from @claude[bot] Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> * Move order of safari vs account checks --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
1 parent e6062ec commit 78f4947

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

apps/browser/src/dirt/phishing-detection/services/phishing-detection.service.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,9 @@ describe("PhishingDetectionService", () => {
7979
// phishingDetectionSettingsService,
8080
// );
8181
// });
82+
83+
// TODO
84+
// it("should not enable phishing detection for safari", () => {
85+
//
86+
// });
8287
});

apps/browser/src/dirt/phishing-detection/services/phishing-detection.service.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
filter,
66
map,
77
merge,
8+
of,
89
Subject,
910
switchMap,
1011
tap,
@@ -111,7 +112,17 @@ export class PhishingDetectionService {
111112
.messages$(PHISHING_DETECTION_CANCEL_COMMAND)
112113
.pipe(switchMap((message) => BrowserApi.closeTab(message.tabId)));
113114

114-
const phishingDetectionActive$ = phishingDetectionSettingsService.on$;
115+
// Phishing detection is unavailable on Safari due to platform limitations
116+
if (BrowserApi.isSafariApi) {
117+
logService.debug(
118+
"[PhishingDetectionService] Disabling phishing detection service for Safari.",
119+
);
120+
}
121+
122+
// Watching for settings changes to enable/disable phishing detection
123+
const phishingDetectionActive$ = BrowserApi.isSafariApi
124+
? of(false)
125+
: phishingDetectionSettingsService.on$;
115126

116127
const initSub = phishingDetectionActive$
117128
.pipe(

0 commit comments

Comments
 (0)