This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86ead43
commit 829deac
Showing
10 changed files
with
119 additions
and
1,912 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<html> | ||
<head> | ||
<title>404</title> | ||
<title>MetaMask</title> | ||
<style> | ||
*{ | ||
padding: 0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const extension = require('extensionizer') | ||
const resolver = require('./resolver.js') | ||
|
||
module.exports = function (provider) { | ||
extension.webRequest.onBeforeRequest.addListener(details => { | ||
const name = details.url.substring(7, details.url.length - 1) | ||
let clearTime = null | ||
extension.tabs.getSelected(null, tab => { | ||
extension.tabs.update(tab.id, { url: 'loading.html' }) | ||
|
||
clearTime = setTimeout(() => { | ||
return extension.tabs.update(tab.id, { url: '404.html' }) | ||
}, 60000) | ||
|
||
resolver.resolve(name, provider).then(ipfsHash => { | ||
clearTimeout(clearTime) | ||
let url = 'https://gateway.ipfs.io/ipfs/' + ipfsHash | ||
return fetch(url, { method: 'HEAD' }).then(response => response.status).then(statusCode => { | ||
if (statusCode !== 200) return 'Local' | ||
extension.tabs.update(tab.id, { url: url }) | ||
}) | ||
.catch(err => { | ||
url = 'https://gateway.ipfs.io/ipfs/' + ipfsHash | ||
extension.tabs.update(tab.id, {url: url}) | ||
return err | ||
}) | ||
}) | ||
.catch(err => { | ||
clearTimeout(clearTime) | ||
const url = err === 'unsupport' ? 'unsupport' : 'error' | ||
extension.tabs.update(tab.id, {url: `${url}.html?name=${name}`}) | ||
}) | ||
}) | ||
return { cancel: true } | ||
}, {urls: ['*://*.eth/']}) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>MetaMask</title> | ||
</head> | ||
<style> | ||
*{ | ||
padding: 0; | ||
margin: 0; | ||
box-sizing: border-box; | ||
} | ||
img{ | ||
display: block; | ||
} | ||
html, body{ | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
@keyframes logoAmin{ | ||
from {transform: scale(1);} | ||
50%{transform: scale(1.1);} | ||
to {transform: scale(1);} | ||
} | ||
.unsupport{ | ||
width: 80%; | ||
height: auto; | ||
overflow: hidden; | ||
padding: 10px; | ||
} | ||
.unsupport > img{ | ||
margin: 0 auto 31px auto; | ||
width: 136px; | ||
height: auto; | ||
animation: logoAmin 1s infinite linear; | ||
} | ||
.unsupport > h1{ | ||
text-align: center; | ||
font-family: Gotham; | ||
font-size: 18px; | ||
font-weight: 500; | ||
font-style: normal; | ||
font-stretch: normal; | ||
line-height: normal; | ||
letter-spacing: 1.3px; | ||
color: #33559f; | ||
} | ||
|
||
</style> | ||
<body> | ||
<div class="unsupport"> | ||
<img src="./images/cancel.png" alt=""> | ||
<h1>ENS resolver only support on Ethereum mainnet</h1> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.