mirror of
https://github.com/bitwarden/browser
synced 2026-02-07 20:24:01 +00:00
Added new features
This commit is contained in:
@@ -151,6 +151,10 @@ export abstract class BrowserPlatformUtilsService implements PlatformUtilsServic
|
||||
return this.getDevice() === DeviceType.SafariExtension;
|
||||
}
|
||||
|
||||
isDuckDuckGo(): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
isIE(): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -55,6 +55,10 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService {
|
||||
return false;
|
||||
}
|
||||
|
||||
isDuckDuckGo(): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
isMacAppStore(): boolean {
|
||||
return ipc.platform.isMacAppStore;
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user