From 02a3fbde995a0de29c16970620936efa68a0a4eb Mon Sep 17 00:00:00 2001 From: Hinton Date: Wed, 16 Dec 2020 21:49:05 +0100 Subject: [PATCH] Disable browser integration on Mac for non MAS version (for now) --- src/app/accounts/settings.component.ts | 13 +++++++++++-- src/locales/en/messages.json | 6 ++++++ src/proxy/nativemessage.ts | 6 +++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/app/accounts/settings.component.ts b/src/app/accounts/settings.component.ts index 396eb8dd7f9..e6f108f76c7 100644 --- a/src/app/accounts/settings.component.ts +++ b/src/app/accounts/settings.component.ts @@ -317,9 +317,18 @@ export class SettingsComponent implements OnInit { } async saveBrowserIntegration() { + if (process.platform ==='darwin' && !this.platformUtilsService.isMacAppStore()) { + await this.platformUtilsService.showDialog( + this.i18nService.t('browserIntegrationMasOnlyDesc'), + this.i18nService.t('browserIntegrationMasOnlyTitle'), + this.i18nService.t('ok'), null, 'warning'); + + this.enableBrowserIntegration = false; + return; + } + await this.storageService.save(ElectronConstants.enableBrowserIntegration, this.enableBrowserIntegration); - this.messagingService.send( - this.enableBrowserIntegration ? 'enableBrowserIntegration' : 'disableBrowserIntegration'); + this.messagingService.send(this.enableBrowserIntegration ? 'enableBrowserIntegration' : 'disableBrowserIntegration'); } private callAnalytics(name: string, enabled: boolean) { diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index 6f70527abe3..307440c5778 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -1447,6 +1447,12 @@ "enableBrowserIntegrationDesc": { "message": "Browser integration is used for biometrics in browser." }, + "browserIntegrationMasOnlyTitle": { + "message": "Browser integration not supported" + }, + "browserIntegrationMasOnlyDesc": { + "message": "Unfortunately browser integration is only supported in the Mac App Store version for now." + }, "approve": { "message": "Approve" }, diff --git a/src/proxy/nativemessage.ts b/src/proxy/nativemessage.ts index 3bcee29a6ce..6bc5488217e 100644 --- a/src/proxy/nativemessage.ts +++ b/src/proxy/nativemessage.ts @@ -83,7 +83,11 @@ export default class NativeMessage { chunks.push(chunk); } - processData(); + try { + processData(); + } catch(e) { + console.error(e); + } }); } }