1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[SM-88] [BEEEP] Add support for chrome.storage.managed for environment urls (#3120)

* Add managed_schema

* Add note on login page which server you are logging into.

* Implement it

* Remove caching logic since it seems unecessary

* Add error

* Handle error in hasManagedEnvironment

* Fix compile
This commit is contained in:
Oscar Hinton
2022-08-08 13:40:09 +02:00
committed by GitHub
parent c263eacd88
commit af371af6e1
13 changed files with 173 additions and 18 deletions

View File

@@ -1,4 +1,3 @@
import { EnvironmentService } from "@bitwarden/common/abstractions/environment.service";
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/abstractions/log.service";
import { MessagingService } from "@bitwarden/common/abstractions/messaging.service";
@@ -6,6 +5,8 @@ import { NotificationsService } from "@bitwarden/common/abstractions/notificatio
import { SystemService } from "@bitwarden/common/abstractions/system.service";
import { Utils } from "@bitwarden/common/misc/utils";
import { BrowserEnvironmentService } from "src/services/browser-environment.service";
import { BrowserApi } from "../browser/browserApi";
import { AutofillService } from "../services/abstractions/autofill.service";
import BrowserPlatformUtilsService from "../services/browserPlatformUtils.service";
@@ -26,7 +27,7 @@ export default class RuntimeBackground {
private i18nService: I18nService,
private notificationsService: NotificationsService,
private systemService: SystemService,
private environmentService: EnvironmentService,
private environmentService: BrowserEnvironmentService,
private messagingService: MessagingService,
private logService: LogService
) {
@@ -227,6 +228,10 @@ export default class RuntimeBackground {
if (this.onInstalledReason != null) {
if (this.onInstalledReason === "install") {
BrowserApi.createNewTab("https://bitwarden.com/browser-start/");
if (await this.environmentService.hasManagedEnvironment()) {
await this.environmentService.setUrlsToManagedEnvironment();
}
}
this.onInstalledReason = null;