mirror of
https://github.com/bitwarden/browser
synced 2025-01-01 20:57:53 +01:00
cleanup safari specific features
This commit is contained in:
parent
c041fd7504
commit
2a7e361300
@ -52,7 +52,7 @@ export default class CommandsBackground {
|
||||
}
|
||||
|
||||
private async generatePasswordToClipboard() {
|
||||
if (this.isSafari || this.isEdge) {
|
||||
if (this.isEdge) {
|
||||
// Safari does not support access to clipboard from background
|
||||
return;
|
||||
}
|
||||
|
@ -368,6 +368,10 @@ export default class MainBackground {
|
||||
// Chrome APIs cannot open popup
|
||||
|
||||
// TODO: Do we need to open this popup?
|
||||
if (!this.isSafari) {
|
||||
return;
|
||||
}
|
||||
await SafariApp.sendMessageToApp('showPopover');
|
||||
|
||||
/*
|
||||
if (!this.isSafari || !safari.extension.toolbarItems || !safari.extension.toolbarItems.length) {
|
||||
|
@ -230,7 +230,7 @@ export class BrowserApi {
|
||||
} else if (BrowserApi.isWebExtensionsApi || BrowserApi.isChromeApi) {
|
||||
win.close();
|
||||
} else if (BrowserApi.isSafariApi) {
|
||||
SafariApp.sendMessageToApp('hideWindow');
|
||||
SafariApp.sendMessageToApp('hidePopover');
|
||||
}
|
||||
}
|
||||
|
||||
@ -293,7 +293,7 @@ export class BrowserApi {
|
||||
if (win != null) {
|
||||
return win.location.reload(true);
|
||||
} else if (BrowserApi.isSafariApi) {
|
||||
SafariApp.sendMessageToApp('reloadWindow');
|
||||
SafariApp.sendMessageToApp('reloadExtension');
|
||||
} else if (!BrowserApi.isSafariApi) {
|
||||
return chrome.runtime.reload();
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ export class OptionsComponent implements OnInit {
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
this.showDisableContextMenu = this.showClearClipboard = !this.platformUtilsService.isSafari();
|
||||
this.showDisableContextMenu = !this.platformUtilsService.isSafari();
|
||||
|
||||
this.enableAutoFillOnPageLoad = await this.storageService.get<boolean>(
|
||||
ConstantsService.enableAutoFillOnPageLoadKey);
|
||||
|
@ -94,7 +94,7 @@ export class SettingsComponent implements OnInit {
|
||||
}
|
||||
|
||||
async saveLockOption(newValue: number) {
|
||||
if (newValue == null && !this.platformUtilsService.isSafari()) {
|
||||
if (newValue == null) {
|
||||
const confirmed = await this.platformUtilsService.showDialog(
|
||||
this.i18nService.t('neverLockWarning'), null,
|
||||
this.i18nService.t('yes'), this.i18nService.t('cancel'), 'warning');
|
||||
|
@ -135,9 +135,15 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if command == "hideWindow" {
|
||||
} else if command == "hidePopover" {
|
||||
dismissPopover()
|
||||
replyMessage(message: m!)
|
||||
} else if command == "showPopover" {
|
||||
// TODO
|
||||
replyMessage(message: m!)
|
||||
} else if command == "reloadExtension" {
|
||||
// TODO
|
||||
replyMessage(message: m!)
|
||||
} else if command == "copyToClipboard" {
|
||||
let pasteboard = NSPasteboard.general
|
||||
pasteboard.declareTypes([NSPasteboard.PasteboardType.string], owner: nil)
|
||||
|
@ -95,6 +95,7 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
|
||||
}
|
||||
|
||||
if (this.isSafari()) {
|
||||
// TODO
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user