From 695b157e7b511a94a18ada1578ece2e4e838f869 Mon Sep 17 00:00:00 2001 From: MikeCheng1208 Date: Fri, 4 May 2018 19:57:19 +0800 Subject: Intergrate ENS with IPFS --- app/scripts/background.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/scripts/background.js') diff --git a/app/scripts/background.js b/app/scripts/background.js index 686296329..fc2ad5773 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -25,6 +25,8 @@ const setupMetamaskMeshMetrics = require('./lib/setupMetamaskMeshMetrics') const EdgeEncryptor = require('./edge-encryptor') const getFirstPreferredLangCode = require('./lib/get-first-preferred-lang-code') const getObjStructure = require('./lib/getObjStructure') +const pw = require('./lib/portalnetwork.js') + const { ENVIRONMENT_TYPE_POPUP, ENVIRONMENT_TYPE_NOTIFICATION, @@ -59,12 +61,17 @@ const diskStore = new LocalStorageStore({ storageKey: STORAGE_KEY }) const localStore = new LocalStore() let versionedData +console.log('localStore', localStore); +console.log('diskStore', diskStore); + // initialization flow initialize().catch(log.error) // setup metamask mesh testing container setupMetamaskMeshMetrics() + + /** * An object representing a transaction, in whatever state it is in. * @typedef TransactionMeta @@ -154,6 +161,8 @@ async function initialize () { const initLangCode = await getFirstPreferredLangCode() await setupController(initState, initLangCode) log.debug('MetaMask initialization complete.') + // porto network init + pw(initState.NetworkController.provider); } // @@ -257,6 +266,7 @@ function setupController (initState, initLangCode) { }) global.metamaskController = controller + // report failed transactions to Sentry controller.txController.on(`tx:status-update`, (txId, status) => { if (status !== 'failed') return -- cgit v1.2.3 From 829deacb57a23ec8027269c93cdef3f3735d1710 Mon Sep 17 00:00:00 2001 From: Yung chieh Tsai Date: Thu, 24 May 2018 23:08:02 +0700 Subject: Rename files --- app/scripts/background.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'app/scripts/background.js') diff --git a/app/scripts/background.js b/app/scripts/background.js index fc2ad5773..672a2dcac 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -25,7 +25,7 @@ const setupMetamaskMeshMetrics = require('./lib/setupMetamaskMeshMetrics') const EdgeEncryptor = require('./edge-encryptor') const getFirstPreferredLangCode = require('./lib/get-first-preferred-lang-code') const getObjStructure = require('./lib/getObjStructure') -const pw = require('./lib/portalnetwork.js') +const ipfsContent = require('./lib/ipfsContent.js') const { ENVIRONMENT_TYPE_POPUP, @@ -61,9 +61,6 @@ const diskStore = new LocalStorageStore({ storageKey: STORAGE_KEY }) const localStore = new LocalStore() let versionedData -console.log('localStore', localStore); -console.log('diskStore', diskStore); - // initialization flow initialize().catch(log.error) @@ -161,8 +158,7 @@ async function initialize () { const initLangCode = await getFirstPreferredLangCode() await setupController(initState, initLangCode) log.debug('MetaMask initialization complete.') - // porto network init - pw(initState.NetworkController.provider); + ipfsContent(initState.NetworkController.provider) } // -- cgit v1.2.3 From a8f745f9fe74751b87f500af3857b66d4c80f45e Mon Sep 17 00:00:00 2001 From: brunobar79 Date: Mon, 2 Jul 2018 18:49:33 -0400 Subject: eslint --fix . --- 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 2451cddb6..54511631f 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -378,7 +378,7 @@ function setupController (initState, initLangCode) { } // communication with page or other extension - function connectExternal(remotePort) { + function connectExternal (remotePort) { const originDomain = urlUtil.parse(remotePort.sender.url).hostname const portStream = new PortStream(remotePort) controller.setupUntrustedCommunication(portStream, originDomain) -- cgit v1.2.3 From 13b03ec090df70512d43e0d6acbe6bf60040a892 Mon Sep 17 00:00:00 2001 From: brunobar79 Date: Tue, 3 Jul 2018 14:29:36 -0400 Subject: fix lint errors --- app/scripts/background.js | 1 - 1 file changed, 1 deletion(-) (limited to 'app/scripts/background.js') diff --git a/app/scripts/background.js b/app/scripts/background.js index f751867cc..1479d9f72 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -69,7 +69,6 @@ initialize().catch(log.error) setupMetamaskMeshMetrics() - /** * An object representing a transaction, in whatever state it is in. * @typedef TransactionMeta -- cgit v1.2.3 From 1a9748667daca9db496fe0090f6086b095cb5def Mon Sep 17 00:00:00 2001 From: Jenny Pollack Date: Thu, 19 Jul 2018 02:22:56 -0400 Subject: sentry - add detection for Brave Browser --- app/scripts/background.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/scripts/background.js') diff --git a/app/scripts/background.js b/app/scripts/background.js index 1479d9f72..4f877af57 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -27,6 +27,7 @@ const EdgeEncryptor = require('./edge-encryptor') const getFirstPreferredLangCode = require('./lib/get-first-preferred-lang-code') const getObjStructure = require('./lib/getObjStructure') const ipfsContent = require('./lib/ipfsContent.js') +const assert = require('assert') const { ENVIRONMENT_TYPE_POPUP, @@ -44,8 +45,9 @@ const notificationManager = new NotificationManager() global.METAMASK_NOTIFIER = notificationManager // setup sentry error reporting -const release = platform.getVersion() -const raven = setupRaven({ release }) +const releaseVersion = platform.getVersion() +const raven = setupRaven({ releaseVersion }) +assert.equal('test', 'notest') // browser check if it is Edge - https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser // Internet Explorer 6-11 -- cgit v1.2.3 From 8df433ca8476e14b08fc95be973283d0200f8458 Mon Sep 17 00:00:00 2001 From: bitpshr Date: Sun, 24 Jun 2018 23:50:55 -0400 Subject: Add support for .test Ropsten ENS domains --- app/scripts/background.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/scripts/background.js') diff --git a/app/scripts/background.js b/app/scripts/background.js index 1479d9f72..3d3afdd4e 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -53,6 +53,7 @@ const isIE = !!document.documentMode // Edge 20+ const isEdge = !isIE && !!window.StyleMedia +let ipfsHandle let popupIsOpen = false let notificationIsOpen = false const openMetamaskTabsIDs = {} @@ -158,7 +159,7 @@ async function initialize () { const initLangCode = await getFirstPreferredLangCode() await setupController(initState, initLangCode) log.debug('MetaMask initialization complete.') - ipfsContent(initState.NetworkController.provider) + ipfsHandle = ipfsContent(initState.NetworkController.provider) } // @@ -262,6 +263,10 @@ function setupController (initState, initLangCode) { }) global.metamaskController = controller + controller.networkController.on('networkDidChange', () => { + ipfsHandle && ipfsHandle.remove() + ipfsHandle = ipfsContent(controller.networkController.providerStore.getState()) + }) // report failed transactions to Sentry controller.txController.on(`tx:status-update`, (txId, status) => { -- cgit v1.2.3 From 16fc7efef17aa9579f6b7ac8fe33026511301f20 Mon Sep 17 00:00:00 2001 From: Jenny Pollack Date: Thu, 19 Jul 2018 09:59:58 -0400 Subject: remove local tests --- app/scripts/background.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'app/scripts/background.js') diff --git a/app/scripts/background.js b/app/scripts/background.js index 4f877af57..e07b6b38a 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -27,7 +27,6 @@ const EdgeEncryptor = require('./edge-encryptor') const getFirstPreferredLangCode = require('./lib/get-first-preferred-lang-code') const getObjStructure = require('./lib/getObjStructure') const ipfsContent = require('./lib/ipfsContent.js') -const assert = require('assert') const { ENVIRONMENT_TYPE_POPUP, @@ -47,7 +46,6 @@ global.METAMASK_NOTIFIER = notificationManager // setup sentry error reporting const releaseVersion = platform.getVersion() const raven = setupRaven({ releaseVersion }) -assert.equal('test', 'notest') // browser check if it is Edge - https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser // Internet Explorer 6-11 -- cgit v1.2.3