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

View File

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

View File

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

View File

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