From 44cf4c623319cae7aae431beeac8c8a4cd7e3a51 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 15 Aug 2019 20:31:23 -0400 Subject: [PATCH] vhange to safari.extension.dispatchMessage --- src/2fa/2fa.ts | 4 ++-- src/content/autofill.js | 2 +- src/content/autofiller.ts | 4 ++-- src/content/notificationBar.ts | 4 ++-- src/content/shortcuts.ts | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/2fa/2fa.ts b/src/2fa/2fa.ts index 47ddc3c8d2..5dd35153d6 100644 --- a/src/2fa/2fa.ts +++ b/src/2fa/2fa.ts @@ -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', }); diff --git a/src/content/autofill.js b/src/content/autofill.js index d1ba38ead2..0c9307da3e 100644 --- a/src/content/autofill.js +++ b/src/content/autofill.js @@ -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, diff --git a/src/content/autofiller.ts b/src/content/autofiller.ts index fcad52d0b1..85a72f56ad 100644 --- a/src/content/autofiller.ts +++ b/src/content/autofiller.ts @@ -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); } diff --git a/src/content/notificationBar.ts b/src/content/notificationBar.ts index 2701f597ce..bc346d991a 100644 --- a/src/content/notificationBar.ts +++ b/src/content/notificationBar.ts @@ -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); } diff --git a/src/content/shortcuts.ts b/src/content/shortcuts.ts index e5ff695508..6b1b1ca5d9 100644 --- a/src/content/shortcuts.ts +++ b/src/content/shortcuts.ts @@ -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); }