1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 01:33:33 +00:00

Simplify forwarding tab messages to runtime

This commit is contained in:
Daniel James Smith
2021-10-19 11:47:25 +02:00
parent d4e91a81f9
commit 344878ef4f

View File

@@ -21,16 +21,10 @@ window.addEventListener('message', event => {
} }
}, false); }, false);
const forwardCommands = ['promptForLogin', 'addToLockedVaultPendingNotifications', 'unlockCompleted'];
chrome.runtime.onMessage.addListener(event => { chrome.runtime.onMessage.addListener(event => {
if (event.command === 'promptForLogin') { if (forwardCommands.includes(event.command)) {
chrome.runtime.sendMessage(event);
}
if (event.command === 'addToLockedVaultPendingNotifications') {
chrome.runtime.sendMessage(event);
}
if (event.command === 'unlockCompleted') {
chrome.runtime.sendMessage(event); chrome.runtime.sendMessage(event);
} }
}); });