mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 02:33:46 +00:00
Reload browser extension after enabling nativeMessaging (#1577)
This commit is contained in:
@@ -214,16 +214,26 @@ export class SettingsComponent implements OnInit {
|
||||
|
||||
// Request permission to use the optional permission for nativeMessaging
|
||||
if (!this.platformUtilsService.isFirefox()) {
|
||||
const granted = await new Promise((resolve, reject) => {
|
||||
chrome.permissions.request({permissions: ['nativeMessaging']}, resolve);
|
||||
const hasPermission = await new Promise((resolve) => {
|
||||
chrome.permissions.contains({permissions: ['nativeMessaging']}, resolve);
|
||||
});
|
||||
|
||||
if (!granted) {
|
||||
if (!hasPermission) {
|
||||
await this.platformUtilsService.showDialog(
|
||||
this.i18nService.t('nativeMessaginPermissionErrorDesc'), this.i18nService.t('nativeMessaginPermissionErrorTitle'),
|
||||
this.i18nService.t('nativeMessagingPermissionPromptDesc'), this.i18nService.t('nativeMessagingPermissionPromptTitle'),
|
||||
this.i18nService.t('ok'), null);
|
||||
this.biometric = false;
|
||||
return;
|
||||
|
||||
const granted = await new Promise((resolve, reject) => {
|
||||
chrome.permissions.request({permissions: ['nativeMessaging']}, resolve);
|
||||
});
|
||||
|
||||
if (!granted) {
|
||||
await this.platformUtilsService.showDialog(
|
||||
this.i18nService.t('nativeMessaginPermissionErrorDesc'), this.i18nService.t('nativeMessaginPermissionErrorTitle'),
|
||||
this.i18nService.t('ok'), null);
|
||||
this.biometric = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user