mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
Make nativeMessaging optional on all platforms except firefox (#1565)
Make nativeMessaging optional on all platforms except firefox
This commit is contained in:
@@ -1438,6 +1438,12 @@
|
||||
"biometricsNotSupportedDesc": {
|
||||
"message": "Browser biometrics is not supported on this device."
|
||||
},
|
||||
"nativeMessaginPermissionErrorTitle": {
|
||||
"message": "Permission not provided"
|
||||
},
|
||||
"nativeMessaginPermissionErrorDesc": {
|
||||
"message": "Without permission to communicate with the Bitwarden Desktop Application we cannot provide biometrics in the browser extension. Please try again."
|
||||
},
|
||||
"personalOwnershipSubmitError": {
|
||||
"message": "Due to an Enterprise Policy, you are restricted from saving items to your personal vault. Change the Ownership option to an organization and choose from available Collections."
|
||||
},
|
||||
|
||||
@@ -23,6 +23,7 @@ import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||
import { StorageService } from 'jslib/abstractions/storage.service';
|
||||
import { UserService } from 'jslib/abstractions/user.service';
|
||||
import { VaultTimeoutService } from 'jslib/abstractions/vaultTimeout.service';
|
||||
import { resolve } from '@angular/compiler-cli/src/ngtsc/file_system';
|
||||
|
||||
const RateUrls = {
|
||||
[DeviceType.ChromeExtension]:
|
||||
@@ -208,6 +209,24 @@ export class SettingsComponent implements OnInit {
|
||||
|
||||
async updateBiometric() {
|
||||
if (this.biometric) {
|
||||
|
||||
// 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']}, function(granted) {
|
||||
resolve(granted);
|
||||
});
|
||||
});
|
||||
|
||||
if (!granted) {
|
||||
await this.platformUtilsService.showDialog(
|
||||
this.i18nService.t('nativeMessaginPermissionErrorDesc'), this.i18nService.t('nativeMessaginPermissionErrorTitle'),
|
||||
this.i18nService.t('ok'), null);
|
||||
this.biometric = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const submitted = Swal.fire({
|
||||
heightAuto: false,
|
||||
buttonsStyling: false,
|
||||
|
||||
Reference in New Issue
Block a user