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:
@@ -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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user