diff --git a/src/content/message_handler.ts b/src/content/message_handler.ts index 361e434fd7..e10834a3d6 100644 --- a/src/content/message_handler.ts +++ b/src/content/message_handler.ts @@ -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); } });