1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

[PM-5742] Rework Usage of Extension APIs that Cannot be Called with the Background Service Worker (#7667)

* [PM-5742] Rework Usage of Extension APIs that Cannot be Called with the Background Service Worker

* [PM-5742] Implementing jest tests for the updated BrowserApi methods

* [PM-5742] Implementing jest tests to validate logic within added API calls

* [PM-5742] Implementing jest tests to validate logic within added API calls

* [PM-5742] Fixing broken Jest tests

* [PM-5742] Fixing linter error
This commit is contained in:
Cesar Gonzalez
2024-02-07 15:20:53 -06:00
committed by GitHub
parent 2e11fb2a24
commit a1745b2dae
6 changed files with 236 additions and 13 deletions

View File

@@ -160,12 +160,12 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
}
// Opera has "sidebar_panel" as a ViewType but doesn't currently work
if (this.isFirefox() && chrome.extension.getViews({ type: "sidebar" }).length > 0) {
if (this.isFirefox() && BrowserApi.getExtensionViews({ type: "sidebar" }).length > 0) {
return true;
}
// Opera sidebar has type of "tab" (will stick around for a while after closing sidebar)
const tabOpen = chrome.extension.getViews({ type: "tab" }).length > 0;
const tabOpen = BrowserApi.getExtensionViews({ type: "tab" }).length > 0;
return tabOpen;
}