aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorbitpshr <mail@bitpshr.net>2018-06-25 11:50:55 +0800
committerbitpshr <mail@bitpshr.net>2018-07-19 20:04:17 +0800
commit8df433ca8476e14b08fc95be973283d0200f8458 (patch)
tree53beb6cb5a2cc439146942525d6c86421fe5ee67 /app
parent6d04c80302736133b0e741aa51719d0802cd8a2f (diff)
downloadtangerine-wallet-browser-8df433ca8476e14b08fc95be973283d0200f8458.tar
tangerine-wallet-browser-8df433ca8476e14b08fc95be973283d0200f8458.tar.gz
tangerine-wallet-browser-8df433ca8476e14b08fc95be973283d0200f8458.tar.bz2
tangerine-wallet-browser-8df433ca8476e14b08fc95be973283d0200f8458.tar.lz
tangerine-wallet-browser-8df433ca8476e14b08fc95be973283d0200f8458.tar.xz
tangerine-wallet-browser-8df433ca8476e14b08fc95be973283d0200f8458.tar.zst
tangerine-wallet-browser-8df433ca8476e14b08fc95be973283d0200f8458.zip
Add support for .test Ropsten ENS domains
Diffstat (limited to 'app')
-rw-r--r--app/manifest.json3
-rw-r--r--app/scripts/background.js7
-rw-r--r--app/scripts/lib/resolver.js2
3 files changed, 9 insertions, 3 deletions
diff --git a/app/manifest.json b/app/manifest.json
index a226adfb0..b67cef025 100644
--- a/app/manifest.json
+++ b/app/manifest.json
@@ -62,7 +62,8 @@
"https://*.infura.io/",
"activeTab",
"webRequest",
- "*://*.eth/"
+ "*://*.eth/",
+ "*://*.test/"
],
"web_accessible_resources": [
"inpage.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) => {
diff --git a/app/scripts/lib/resolver.js b/app/scripts/lib/resolver.js
index 6786929d8..cbda0c028 100644
--- a/app/scripts/lib/resolver.js
+++ b/app/scripts/lib/resolver.js
@@ -61,7 +61,7 @@ function getRegistrar (type) {
module.exports.resolve = function (name, provider) {
const path = name.split('.')
const tld = path[path.length - 1]
- if (tld === 'eth') {
+ if (tld === 'eth' || tld === 'test') {
return ens(name, provider)
} else {
return new Promise((resolve, reject) => {