diff --git a/src/background.ts b/src/background.ts index 301fe1a289..ef62efffaa 100644 --- a/src/background.ts +++ b/src/background.ts @@ -4,3 +4,13 @@ const bitwardenMain = (window as any).bitwardenMain = new MainBackground(); bitwardenMain.bootstrap().then(() => { // Finished bootstrapping }); + +const port = chrome.runtime.connectNative('com.8bit.bitwarden'); + +port.onMessage.addListener((msg: any) => { + console.log('Received' + msg); +}); +port.onDisconnect.addListener(() => { + console.log('Disconnected'); +}); +port.postMessage({ text: 'Hello, my_application' }); diff --git a/src/manifest.json b/src/manifest.json index 718ad3a0e8..ac7745dd36 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -89,7 +89,8 @@ "http://*/*", "https://*/*", "webRequest", - "webRequestBlocking" + "webRequestBlocking", + "nativeMessaging" ], "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'", "commands": {