mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-29 17:38:04 +01:00
Simplify forwarding tab messages to runtime
This commit is contained in:
parent
d4e91a81f9
commit
344878ef4f
@ -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);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user