Cleanup a few more safari things

This commit is contained in:
Hinton 2020-12-09 13:18:29 +01:00
parent 27ca7cc739
commit 7b5ec47ba5
4 changed files with 4 additions and 14 deletions

View File

@ -96,7 +96,7 @@
</div>
<div class="box-footer">{{'disableChangedPasswordNotificationDesc' | i18n}}</div>
</div>
<div class="box" *ngIf="showDisableContextMenu">
<div class="box">
<div class="box-content">
<div class="box-content-row box-content-row-checkbox" appBoxRow>
<label for="context-menu">{{'disableContextMenuItem' | i18n}}</label>

View File

@ -29,7 +29,6 @@ export class OptionsComponent implements OnInit {
disableChangedPasswordNotification = false;
dontShowCards = false;
dontShowIdentities = false;
showDisableContextMenu = true;
showClearClipboard = true;
theme: string;
themeOptions: any[];
@ -68,8 +67,6 @@ export class OptionsComponent implements OnInit {
}
async ngOnInit() {
this.showDisableContextMenu = !this.platformUtilsService.isSafari();
this.enableAutoFillOnPageLoad = await this.storageService.get<boolean>(
ConstantsService.enableAutoFillOnPageLoadKey);

View File

@ -26,7 +26,7 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
return this.deviceCache;
}
if (this.isSafariExtension()) {
if (navigator.userAgent.indexOf(' Safari/') !== -1) {
this.deviceCache = DeviceType.SafariExtension;
} else if (navigator.userAgent.indexOf(' Firefox/') !== -1 || navigator.userAgent.indexOf(' Gecko/') !== -1) {
this.deviceCache = DeviceType.FirefoxExtension;
@ -237,7 +237,7 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
doc = options.doc;
}
if (this.isSafariExtension()) {
if (this.isSafari()) {
return await SafariApp.sendMessageToApp('readFromClipboard');
} else if (this.isFirefox() && (win as any).navigator.clipboard && (win as any).navigator.clipboard.readText) {
return await (win as any).navigator.clipboard.readText();
@ -303,8 +303,4 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
supportsSecureStorage(): boolean {
return false;
}
private isSafariExtension(): boolean {
return navigator.userAgent.indexOf(' Safari/') !== -1;
}
}

View File

@ -1,7 +1,4 @@
import {
PlatformUtilsService,
StorageService,
} from 'jslib/abstractions';
import { StorageService } from 'jslib/abstractions/storage.service';
export default class BrowserStorageService implements StorageService {
private chromeStorageApi: any;