1
0
mirror of https://github.com/bitwarden/browser synced 2024-12-26 09:54:35 +01:00

WIP desktop communication

This commit is contained in:
Hinton 2020-10-05 15:44:19 +02:00
parent 2e20192f1b
commit 296ccb6829
2 changed files with 12 additions and 1 deletions

View File

@ -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' });

View File

@ -89,7 +89,8 @@
"http://*/*",
"https://*/*",
"webRequest",
"webRequestBlocking"
"webRequestBlocking",
"nativeMessaging"
],
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
"commands": {