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
1 changed files with 3 additions and 9 deletions

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