1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Merge pull request #5010 from eduadiez/develop

Fix ENS resolution issues
This commit is contained in:
Thomas Huang 2018-08-09 09:47:25 -07:00 committed by GitHub
commit 09b81a2d22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,7 @@ module.exports = function (provider) {
function ipfsContent (details) {
const name = details.url.substring(7, details.url.length - 1)
let clearTime = null
extension.tabs.getSelected(null, tab => {
extension.tabs.query({active: true}, tab => {
extension.tabs.update(tab.id, { url: 'loading.html' })
clearTime = setTimeout(() => {
@ -34,11 +34,11 @@ module.exports = function (provider) {
return { cancel: true }
}
extension.webRequest.onBeforeRequest.addListener(ipfsContent, {urls: ['*://*.eth/', '*://*.test/']})
extension.webRequest.onErrorOccurred.addListener(ipfsContent, {urls: ['*://*.eth/', '*://*.test/']})
return {
remove () {
extension.webRequest.onBeforeRequest.removeListener(ipfsContent)
extension.webRequest.onErrorOccurred.removeListener(ipfsContent)
},
}
}