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

View File

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

View File

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

View File

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

View File

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