diff options
Diffstat (limited to 'mobile/android/android-components/components/feature/accounts/src/main/assets/extensions/fxawebchannel/fxawebchannel.js')
-rw-r--r-- | mobile/android/android-components/components/feature/accounts/src/main/assets/extensions/fxawebchannel/fxawebchannel.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/mobile/android/android-components/components/feature/accounts/src/main/assets/extensions/fxawebchannel/fxawebchannel.js b/mobile/android/android-components/components/feature/accounts/src/main/assets/extensions/fxawebchannel/fxawebchannel.js index 2f5934dff1..16614d3069 100644 --- a/mobile/android/android-components/components/feature/accounts/src/main/assets/extensions/fxawebchannel/fxawebchannel.js +++ b/mobile/android/android-components/components/feature/accounts/src/main/assets/extensions/fxawebchannel/fxawebchannel.js @@ -10,16 +10,18 @@ let port = browser.runtime.connectNative("mozacWebchannel"); /* Handle messages from native application, dispatch them to FxA via an event. */ -port.onMessage.addListener((event) => { - window.dispatchEvent(new CustomEvent('WebChannelMessageToContent', { - detail: JSON.stringify(event) - })); +port.onMessage.addListener(event => { + window.dispatchEvent( + new CustomEvent("WebChannelMessageToContent", { + detail: JSON.stringify(event), + }) + ); }); /* Handle messages from FxA. Messages are posted to the native application for processing. */ -window.addEventListener('WebChannelMessageToChrome', function (e) { +window.addEventListener("WebChannelMessageToChrome", function (e) { const detail = JSON.parse(e.detail); port.postMessage(detail); }); |