1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-07 09:31:31 +01:00

vhange to safari.extension.dispatchMessage

This commit is contained in:
Kyle Spearrin 2019-08-15 20:31:23 -04:00
parent af77175616
commit 44cf4c6233
5 changed files with 8 additions and 8 deletions

View File

@ -25,7 +25,7 @@ document.addEventListener('DOMContentLoaded', () => {
submit_callback: (theForm: Document) => {
const sigElement = theForm.querySelector('input[name="sig_response"]') as HTMLInputElement;
if (sigElement) {
safari.self.tab.dispatchMessage('bitwarden', {
safari.extension.dispatchMessage('bitwarden', {
command: '2faPageResponse',
type: 'duo',
data: {
@ -36,7 +36,7 @@ document.addEventListener('DOMContentLoaded', () => {
},
});
} else if (msg.data.type === 'success') {
safari.self.tab.dispatchMessage('bitwarden', {
safari.extension.dispatchMessage('bitwarden', {
command: 'openPopup',
});

View File

@ -998,7 +998,7 @@
if (msg.command === 'collectPageDetails') {
var pageDetails = collect(document);
var pageDetailsObj = JSON.parse(pageDetails);
safari.self.tab.dispatchMessage('bitwarden', {
safari.extension.dispatchMessage('bitwarden', {
command: 'collectPageDetailsResponse',
tab: msg.tab,
details: pageDetailsObj,

View File

@ -11,7 +11,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
(window as any).__bitwardenFrameId = Math.floor(Math.random() * Math.floor(99999999));
}
const responseCommand = 'autofillerAutofillOnPageLoadEnabledResponse';
safari.self.tab.dispatchMessage('bitwarden', {
safari.extension.dispatchMessage('bitwarden', {
command: 'bgGetDataForTab',
responseCommand: responseCommand,
bitwardenFrameId: (window as any).__bitwardenFrameId,
@ -66,7 +66,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
if (isSafari) {
msg.bitwardenFrameId = (window as any).__bitwardenFrameId;
safari.self.tab.dispatchMessage('bitwarden', msg);
safari.extension.dispatchMessage('bitwarden', msg);
} else {
chrome.runtime.sendMessage(msg);
}

View File

@ -32,7 +32,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
}
const responseCommand = 'notificationBarDataResponse';
safari.self.tab.dispatchMessage('bitwarden', {
safari.extension.dispatchMessage('bitwarden', {
command: 'bgGetDataForTab',
responseCommand: responseCommand,
bitwardenFrameId: (window as any).__bitwardenFrameId,
@ -581,7 +581,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
function sendPlatformMessage(msg: any) {
if (isSafari) {
msg.bitwardenFrameId = (window as any).__bitwardenFrameId;
safari.self.tab.dispatchMessage('bitwarden', msg);
safari.extension.dispatchMessage('bitwarden', msg);
} else {
chrome.runtime.sendMessage(msg);
}

View File

@ -41,7 +41,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
if (isSafari) {
msg.bitwardenFrameId = (window as any).__bitwardenFrameId;
safari.self.tab.dispatchMessage('bitwarden', msg);
safari.extension.dispatchMessage('bitwarden', msg);
} else {
chrome.runtime.sendMessage(msg);
}