From b70d2fb3c348b64c581bfb1fbb41c39d0b0fabe1 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Tue, 7 Dec 2021 20:04:52 +0000 Subject: [PATCH] Fix development build not working with bitwarden:// protocol (#1165) --- src/main.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index b4d3adb1..071be867 100644 --- a/src/main.ts +++ b/src/main.ts @@ -131,7 +131,14 @@ export class Main { this.nativeMessagingMain.listen(); } - if (!app.isDefaultProtocolClient('bitwarden')) { + app.removeAsDefaultProtocolClient('bitwarden'); + if (process.env.NODE_ENV === 'development' && process.platform === 'win32') { + // Fix development build on Windows requirering a different protocol client + app.setAsDefaultProtocolClient('bitwarden', process.execPath, [ + process.argv[1], + path.resolve(process.argv[2]), + ]); + } else { app.setAsDefaultProtocolClient('bitwarden'); }