From 02f5502e16fefc8d92392e614861e3f672c4f909 Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 11 Jun 2018 11:04:28 -0700 Subject: test - e2e - inject metamask config to point at localhost --- app/scripts/background.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/scripts/background.js') diff --git a/app/scripts/background.js b/app/scripts/background.js index 56e190f97..41fd89016 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -18,7 +18,7 @@ const migrations = require('./migrations/') const PortStream = require('./lib/port-stream.js') const NotificationManager = require('./lib/notification-manager.js') const MetamaskController = require('./metamask-controller') -const firstTimeState = require('./first-time-state') +const rawFirstTimeState = require('./first-time-state') const setupRaven = require('./lib/setupRaven') const reportFailedTxToSentry = require('./lib/reportFailedTxToSentry') const setupMetamaskMeshMetrics = require('./lib/setupMetamaskMeshMetrics') @@ -31,6 +31,8 @@ const { ENVIRONMENT_TYPE_FULLSCREEN, } = require('./lib/enums') +const firstTimeState = Object.assign({}, rawFirstTimeState, global.METAMASK_CONFIG) + const STORAGE_KEY = 'metamask-config' const METAMASK_DEBUG = process.env.METAMASK_DEBUG -- cgit v1.2.3 From ebb9447593a877cd299e701ddfcb217070068fac Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 11 Jun 2018 14:25:49 -0700 Subject: test - e2e - factor out setup phase + rename METAMASK_CONFIG to METAMASK_TEST_CONFIG --- app/scripts/background.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/scripts/background.js') diff --git a/app/scripts/background.js b/app/scripts/background.js index 41fd89016..9866ff0b0 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -31,7 +31,8 @@ const { ENVIRONMENT_TYPE_FULLSCREEN, } = require('./lib/enums') -const firstTimeState = Object.assign({}, rawFirstTimeState, global.METAMASK_CONFIG) +// METAMASK_TEST_CONFIG is used in e2e tests to set the default network to localhost +const firstTimeState = Object.assign({}, rawFirstTimeState, global.METAMASK_TEST_CONFIG) const STORAGE_KEY = 'metamask-config' const METAMASK_DEBUG = process.env.METAMASK_DEBUG -- cgit v1.2.3 From 5d7c2810a701097ef1a4f9de23948418340f9cb4 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 18 Jun 2018 15:05:41 -0700 Subject: Begin adding eth_watchToken --- app/scripts/background.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/scripts/background.js') diff --git a/app/scripts/background.js b/app/scripts/background.js index 2451cddb6..2be600c4b 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -248,6 +248,7 @@ function setupController (initState, initLangCode) { showUnconfirmedMessage: triggerUi, unlockAccountMessage: triggerUi, showUnapprovedTx: triggerUi, + showAddTokenUi: triggerUi, // initial state initState, // initial locale code @@ -436,3 +437,4 @@ extension.runtime.onInstalled.addListener(function (details) { extension.tabs.create({url: 'https://metamask.io/#how-it-works'}) } }) + -- cgit v1.2.3 From 6ce119d1fbf458fa93c63198da7e5bff3045d955 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 20 Aug 2018 15:39:03 -0700 Subject: Move inpage-provider and port-stream outside With the creation of the [metamask-extension-provider](https://github.com/MetaMask/metamask-extension-provider) we have our first non-core module that is dependent on the inpage-provider and port-stream. To reduce the size of its dependencies, I have moved the [metamask-inpage-provider](https://github.com/MetaMask/metamask-inpage-provider) into its own module, as well as [extension-port-stream](https://github.com/MetaMask/extension-port-stream). This allows them to be more easily depended & iterated on by external projects. --- app/scripts/background.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/scripts/background.js') diff --git a/app/scripts/background.js b/app/scripts/background.js index c7395c810..d4d87e0d5 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -15,7 +15,7 @@ const asStream = require('obs-store/lib/asStream') const ExtensionPlatform = require('./platforms/extension') const Migrator = require('./lib/migrator/') const migrations = require('./migrations/') -const PortStream = require('./lib/port-stream.js') +const PortStream = require('extension-port-stream') const createStreamSink = require('./lib/createStreamSink') const NotificationManager = require('./lib/notification-manager.js') const MetamaskController = require('./metamask-controller') -- cgit v1.2.3 From 68c1b4c17049e3ef18397ae83b0eb9da8cccab2c Mon Sep 17 00:00:00 2001 From: Esteban MIno Date: Mon, 20 Aug 2018 22:32:14 -0300 Subject: watchAsset returns result wether token was added or not --- app/scripts/background.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'app/scripts/background.js') diff --git a/app/scripts/background.js b/app/scripts/background.js index 029ad139a..1913d35dd 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -256,7 +256,7 @@ function setupController (initState, initLangCode) { showUnconfirmedMessage: triggerUi, unlockAccountMessage: triggerUi, showUnapprovedTx: triggerUi, - showAddTokenUi: triggerUi, + showWatchAssetUi: showWatchAssetUi, // initial state initState, // initial locale code @@ -444,6 +444,24 @@ function triggerUi () { }) } +/** + * Opens the browser popup for user confirmation of watchAsset + * then it waits until user interact with the UI + */ +function showWatchAssetUi () { + triggerUi() + return new Promise( + (resolve) => { + var interval = setInterval(() => { + if (!notificationIsOpen) { + clearInterval(interval) + resolve() + } + }, 1000) + } + ) +} + // On first install, open a window to MetaMask website to how-it-works. extension.runtime.onInstalled.addListener(function (details) { if ((details.reason === 'install') && (!METAMASK_DEBUG)) { -- cgit v1.2.3 From 83666e8d28d7bf7aa6cea140be359622ec781bd8 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Tue, 25 Sep 2018 11:05:17 -0230 Subject: Update extension badge with correct signTypedData count --- app/scripts/background.js | 1 + 1 file changed, 1 insertion(+) (limited to 'app/scripts/background.js') diff --git a/app/scripts/background.js b/app/scripts/background.js index 546fef569..ae450352e 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -406,6 +406,7 @@ function setupController (initState, initLangCode) { controller.txController.on('update:badge', updateBadge) controller.messageManager.on('updateBadge', updateBadge) controller.personalMessageManager.on('updateBadge', updateBadge) + controller.typedMessageManager.on('updateBadge', updateBadge) /** * Updates the Web Extension's "badge" number, on the little fox in the toolbar. -- cgit v1.2.3 From ba39fbeb49c0691885a92e3df70b3df912144531 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Tue, 2 Oct 2018 11:27:47 -0230 Subject: Don't open metamask.io after install anymore --- app/scripts/background.js | 9 --------- 1 file changed, 9 deletions(-) (limited to 'app/scripts/background.js') diff --git a/app/scripts/background.js b/app/scripts/background.js index ae450352e..0343e134c 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -38,7 +38,6 @@ const { const firstTimeState = Object.assign({}, rawFirstTimeState, global.METAMASK_TEST_CONFIG) const STORAGE_KEY = 'metamask-config' -const METAMASK_DEBUG = process.env.METAMASK_DEBUG log.setDefaultLevel(process.env.METAMASK_DEBUG ? 'debug' : 'warn') @@ -462,11 +461,3 @@ function showWatchAssetUi () { } ) } - -// On first install, open a window to MetaMask website to how-it-works. -extension.runtime.onInstalled.addListener(function (details) { - if ((details.reason === 'install') && (!METAMASK_DEBUG)) { - extension.tabs.create({url: 'https://metamask.io/#how-it-works'}) - } -}) - -- cgit v1.2.3