From 6a60562d6649d88f24bd849b325871bb256a0001 Mon Sep 17 00:00:00 2001 From: Sneh Koul <35871990+Sneh1999@users.noreply.github.com> Date: Wed, 24 Apr 2019 10:49:38 -0700 Subject: [PATCH] =?UTF-8?q?Opens=20the=20original=20webpage=20from=20where?= =?UTF-8?q?=20installation=20of=20MetaMask=20was=20re=E2=80=A6=20(#6272)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Opens the original webpage from where installation of MetaMask was requested * Asking for dynamic permissions * code for forwarder/without extra permissions * Lint fix for onboardingComplete message sending code. --- app/scripts/inpage.js | 6 ++++++ app/scripts/metamask-controller.js | 1 + 2 files changed, 7 insertions(+) diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js index 68394d1ae..71cfb875c 100644 --- a/app/scripts/inpage.js +++ b/app/scripts/inpage.js @@ -218,6 +218,12 @@ inpageProvider.publicConfigStore.subscribe(function (state) { web3.eth.defaultAccount = state.selectedAddress }) +inpageProvider.publicConfigStore.subscribe(function (state) { + if (state.onboardingcomplete) { + window.postMessage('onboardingcomplete', '*') + } +}) + // need to make sure we aren't affected by overlapping namespaces // and that we dont affect the app with our namespace // mostly a fix for web3's BigNumber if AMD's "define" is defined... diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index d2a55acaa..0506e3116 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -320,6 +320,7 @@ module.exports = class MetamaskController extends EventEmitter { const result = { selectedAddress: memState.isUnlocked ? memState.selectedAddress : undefined, networkVersion: memState.network, + onboardingcomplete: memState.completedOnboarding, } return result }