mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
add bitwardenFrameId checks to all content scripts
This commit is contained in:
@@ -10,6 +10,10 @@ document.addEventListener('DOMContentLoaded', (event) => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isSafari && (window as any).__bitwardenFrameId == null) {
|
||||
(window as any).__bitwardenFrameId = Math.floor(Math.random() * Math.floor(99999999));
|
||||
}
|
||||
|
||||
Mousetrap.prototype.stopCallback = () => {
|
||||
return false;
|
||||
};
|
||||
@@ -30,12 +34,13 @@ document.addEventListener('DOMContentLoaded', (event) => {
|
||||
}
|
||||
|
||||
function sendMessage(shortcut: string) {
|
||||
const msg = {
|
||||
const msg: any = {
|
||||
command: 'keyboardShortcutTriggered',
|
||||
shortcut: shortcut,
|
||||
};
|
||||
|
||||
if (isSafari) {
|
||||
msg.bitwardenFrameId = (window as any).__bitwardenFrameId;
|
||||
safari.self.tab.dispatchMessage('bitwarden', msg);
|
||||
} else {
|
||||
chrome.runtime.sendMessage(msg);
|
||||
|
||||
Reference in New Issue
Block a user