1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-07 20:24:01 +00:00

Added new features

This commit is contained in:
Todd Martin
2025-05-10 15:28:34 -04:00
parent ba824c87d1
commit 8d53b10c36
7 changed files with 14 additions and 27 deletions

View File

@@ -151,6 +151,10 @@ export abstract class BrowserPlatformUtilsService implements PlatformUtilsServic
return this.getDevice() === DeviceType.SafariExtension;
}
isDuckDuckGo(): boolean {
return false;
}
isIE(): boolean {
return false;
}

View File

@@ -55,6 +55,10 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService {
return false;
}
isDuckDuckGo(): boolean {
return false;
}
isMacAppStore(): boolean {
return ipc.platform.isMacAppStore;
}

View File

@@ -12,7 +12,7 @@ export class WebFileDownloadService implements FileDownloadService {
download(request: FileDownloadRequest): void {
const builder = new FileDownloadBuilder(request);
const a = window.document.createElement("a");
if (!this.platformUtilsService.isSafari()) {
if (!(this.platformUtilsService.isSafari() || this.platformUtilsService.isDuckDuckGo())) {
a.rel = "noreferrer";
a.target = "_blank";
}

View File

@@ -88,6 +88,10 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
return this.getDevice() === DeviceType.SafariBrowser;
}
isDuckDuckGo(): boolean {
return this.getDevice() === DeviceType.DuckDuckGoBrowser;
}
isMacAppStore(): boolean {
return false;
}

View File

@@ -179,22 +179,4 @@ export class SecretsListComponent implements OnDestroy {
i18nService.t("valueCopied", i18nService.t("uuid")),
);
}
/**
* TODO: Remove in favor of updating `PlatformUtilsService.copyToClipboard`
*/
private static copyToClipboardAsync(
text: Promise<string>,
platformUtilsService: PlatformUtilsService,
) {
if (platformUtilsService.isSafari()) {
return navigator.clipboard.write([
new ClipboardItem({
["text/plain"]: text,
}),
]);
}
return text.then((t) => platformUtilsService.copyToClipboard(t));
}
}

View File

@@ -146,14 +146,6 @@ export class AddEditComponent implements OnInit, OnDestroy {
return null;
}
get isSafari() {
return this.platformUtilsService.isSafari();
}
get isDateTimeLocalSupported(): boolean {
return !(this.platformUtilsService.isFirefox() || this.platformUtilsService.isSafari());
}
async ngOnInit() {
this.accountService.activeAccount$
.pipe(

View File

@@ -21,6 +21,7 @@ export abstract class PlatformUtilsService {
abstract isOpera(): boolean;
abstract isVivaldi(): boolean;
abstract isSafari(): boolean;
abstract isDuckDuckGo(): boolean;
abstract isMacAppStore(): boolean;
abstract isViewOpen(): Promise<boolean>;
abstract launchUri(uri: string, options?: any): void;