1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-28 17:27:50 +01: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
No known key found for this signature in database
GPG Key ID: 03E4BD365FF06726

View File

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