├── .babelrc ├── .gitignore ├── CHANGELOG.md ├── README.md ├── package-lock.json ├── package.json ├── postcss.config.js ├── src ├── JSON │ └── manifest.json ├── assets │ ├── 128x128.png │ ├── 404.png │ ├── 48x48.png │ ├── all.js │ ├── deadface.png │ ├── loginglogo.png │ ├── loginglogo.svg │ └── logo.png ├── background.js ├── components │ ├── Content.vue │ ├── Error.vue │ ├── Header.vue │ ├── IconItem.vue │ ├── Loading.vue │ ├── Popup.vue │ ├── Powered.vue │ └── not404.vue ├── error.js ├── images │ ├── .DS_Store │ ├── 404.png │ ├── Assets │ │ ├── Browser extension.png │ │ ├── bg.svg │ │ ├── black │ │ │ ├── yellow eyes.svg │ │ │ └── yellow eyes@2x.png │ │ ├── blocks.png │ │ ├── blocks.svg │ │ ├── blocks@2x.png │ │ ├── etc.svg │ │ ├── etc@2x.png │ │ ├── eth.svg │ │ ├── eth@2x.png │ │ ├── extensionlogo.svg │ │ ├── extensionlogo@2x.png │ │ ├── icon.svg │ │ ├── icon@2x.png │ │ ├── link.svg │ │ ├── link@2x.png │ │ ├── logo.svg │ │ ├── logo@2x.png │ │ ├── qtum.svg │ │ ├── qtum@2x.png │ │ ├── wan.svg │ │ └── wan@2x.png │ ├── Browser extension elephant-04.png │ ├── Browser extension.png │ ├── ChromeStore │ │ ├── arrow.svg │ │ ├── arrow@2x.png │ │ ├── bg.svg │ │ ├── bg@2x.png │ │ ├── bg_2.png │ │ ├── bg_2.svg │ │ ├── bg_3.svg │ │ ├── bg_3@2x.png │ │ ├── extension_logo.svg │ │ ├── extension_logo@2x.png │ │ ├── extension_page.png │ │ ├── logo.png │ │ ├── store_search_result.png │ │ ├── te.svg │ │ └── te@2x.png │ ├── deadface.png │ ├── loginglogo.png │ ├── loginglogo.svg │ ├── logo.png │ ├── logo2.png │ └── pwlogo.png ├── lib │ ├── Registrar │ │ └── index.js │ ├── abi │ │ ├── registry.js │ │ └── resolver.js │ └── resolver.js ├── loading.js ├── not404.js ├── popup.js ├── scss │ └── global │ │ ├── _mixin.scss │ │ ├── _reset.scss │ │ ├── global.scss │ │ └── pop.scss └── template │ ├── error.html │ ├── loading.html │ └── popup.html ├── test └── README.md ├── webpack.config.js └── zipfile.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["env", "es2015", "stage-2"], 3 | "plugins": [ 4 | "babel-plugin-transform-class-properties", 5 | "transform-es3-member-expression-literals", 6 | "transform-async-to-generator", 7 | "transform-object-rest-spread", 8 | "transform-runtime" 9 | ] 10 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | tmp 4 | ppt 5 | app 6 | .vscode 7 | *.lnk 8 | /.sass-cache 9 | old 10 | *.zip -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## [0.3.8] - 2018-06-20 4 | 5 | Add new blockchain domain. 6 | Domain support: 7 | - .eth 8 | - .etc 9 | - .wan 10 | 11 | ## [0.2.0] - 2018-03-04 12 | 13 | Add new blockchain domain. 14 | Domain support: 15 | - .eth 16 | - .etc 17 | 18 | ## [0.1.0] - 2018-02-22 19 | 20 | Update IPFS target link. 21 | 22 | ## [0.0.2] - 2018-02-20 23 | 24 | Update logo and information. 25 | 26 | ## [0.0.1] - 2018-02-18 27 | An extension that support users can bridge between blockchain domains and IPFS. 28 | 29 | Domain support: 30 | - .eth 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Portal Network Browser Extension 2 | 3 | ## Install 4 | 5 | [Install Link](https://chrome.google.com/webstore/detail/portal-network/apcnffelpkinnpoapmokieojaffmcpmf) 6 | 7 | ## Simple Summary 8 | Portal Network browser extension can use your browser to interact with IPFS content by Ethereum Name Service(ENS), Ethereum Classic Name Service(ECNS) and Wanchain Name Service(WNS) resovler smart contract. 9 | 10 | ## Motivation 11 | Portal Network browser extension parse IPFS hashes and redirects your browser to content with the IPFS data provider(`ipfs.infura.io`). 12 | 13 | ## Specification 14 | Resolve from ENS, ECNS, WNS Public Resolver `getContent` hash to IPFS hash, and redirect url to `ipfs.infura.io`. 15 | 16 | ## Development 17 | ``` 18 | npm run watch 19 | ``` 20 | 21 | ## Build for Publishing 22 | ``` 23 | npm run deploy 24 | ``` 25 | 26 | ## Unit Test 27 | ``` 28 | npm run test 29 | ``` -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "watch": "cross-env NODE_ENV=development webpack --watch --mode development", 4 | "deploy": "cross-env NODE_ENV=production webpack --mode production && node zipfile.js", 5 | "zip": "node zipfile.js" 6 | }, 7 | "devDependencies": { 8 | "archiver": "^3.0.0", 9 | "autoprefixer": "^9.0.0", 10 | "babel-core": "^6.26.3", 11 | "babel-loader": "^7.1.5", 12 | "babel-plugin-transform-async-to-generator": "^6.24.1", 13 | "babel-plugin-transform-class-properties": "^6.24.1", 14 | "babel-plugin-transform-es3-member-expression-literals": "^6.22.0", 15 | "babel-plugin-transform-export-extensions": "^6.22.0", 16 | "babel-plugin-transform-object-rest-spread": "^6.26.0", 17 | "babel-plugin-transform-runtime": "^6.23.0", 18 | "babel-polyfill": "^6.26.0", 19 | "babel-preset-env": "^1.7.0", 20 | "babel-preset-es2015": "^6.24.1", 21 | "babel-preset-stage-2": "^6.24.1", 22 | "copy-webpack-plugin": "^4.5.2", 23 | "cross-env": "^5.2.0", 24 | "css-loader": "^1.0.0", 25 | "es6-object-assign": "^1.1.0", 26 | "es6-promise": "^4.2.4", 27 | "eth-ens-namehash": "^2.0.8", 28 | "extensionizer": "^1.0.1", 29 | "extract-text-webpack-plugin": "^3.0.2", 30 | "file-loader": "^1.1.11", 31 | "html-loader": "^0.5.5", 32 | "html-webpack-plugin": "^3.2.0", 33 | "image-loader": "0.0.1", 34 | "image-webpack-loader": "^4.3.1", 35 | "imagemin-gifsicle": "^5.2.0", 36 | "imagemin-jpegtran": "^5.0.2", 37 | "imagemin-pngquant": "^6.0.0", 38 | "loader-utils": "^1.1.0", 39 | "multihashes": "^0.4.12", 40 | "node-sass": "^4.9.2", 41 | "npm": "^6.4.1", 42 | "npm-run-all": "^4.1.3", 43 | "postcss-loader": "^2.1.6", 44 | "sass-loader": "^7.0.3", 45 | "style-loader": "^0.21.0", 46 | "url-loader": "^1.0.1", 47 | "url-parse": "^1.4.1", 48 | "vue": "^2.5.16", 49 | "vue-html-loader": "^1.2.4", 50 | "vue-loader": "^15.2.6", 51 | "vue-svg-loader": "^0.10.0", 52 | "vue-template-compiler": "^2.5.16", 53 | "web3": "^1.0.0-beta.26", 54 | "webpack": "^4.16.1", 55 | "webpack-cli": "^3.1.0", 56 | "webpack-manifest-plugin": "^2.0.3", 57 | "websocket": "^1.0.28" 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => { 2 | return { 3 | plugins: { 4 | "autoprefixer": { 5 | browsers: ['> 1%', 'last 5 versions', 'Firefox >= 45', 'iOS >=8', 'Safari >=8','ie >= 10'] 6 | }, 7 | } 8 | }; 9 | }; -------------------------------------------------------------------------------- /src/JSON/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "Portal Network", 4 | "description": "Portal Network Browser Extension", 5 | "version": "0.4.1", 6 | "browser_action": { 7 | "default_icon": "assets/128x128.png", 8 | "default_popup": "popup.html" 9 | }, 10 | "background": { 11 | "scripts": ["background.js"] 12 | }, 13 | "icons": { 14 | "48": "assets/48x48.png", 15 | "128": "assets/128x128.png" 16 | }, 17 | "permissions": [ 18 | "activeTab", 19 | "storage", 20 | "webRequest", 21 | "*://*.eth/", 22 | "*://*.etc/", 23 | "*://*.wan/", 24 | "*://*.bch/" 25 | ], 26 | "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'", 27 | "web_accessible_resources": [ 28 | "*" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /src/assets/128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/assets/128x128.png -------------------------------------------------------------------------------- /src/assets/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/assets/404.png -------------------------------------------------------------------------------- /src/assets/48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/assets/48x48.png -------------------------------------------------------------------------------- /src/assets/deadface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/assets/deadface.png -------------------------------------------------------------------------------- /src/assets/loginglogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/assets/loginglogo.png -------------------------------------------------------------------------------- /src/assets/loginglogo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | logo2 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/assets/logo.png -------------------------------------------------------------------------------- /src/background.js: -------------------------------------------------------------------------------- 1 | const extension = require('extensionizer'); 2 | 3 | extension.webRequest.onBeforeRequest.addListener(details => { 4 | // details.url will look like「http:///」 5 | const name = details.url.substring(7, details.url.length - 1); 6 | if (/^.+\.(eth|wan|etc|bch)$/.test(name) === false) { 7 | return; 8 | } 9 | extension.tabs.query({ currentWindow: true, active: true }, tab => { 10 | extension.tabs.update(tab[0].id, { url: `loading.html?tabid=${tab[0].id}&name=${name}` }); 11 | }); 12 | 13 | return { cancel: true }; 14 | }, { 15 | urls: [ 16 | "*://*.eth/", 17 | '*://*.eth/*', 18 | "*://*.etc/", 19 | '*://*.etc/*', 20 | "*://*.wan/", 21 | '*://*.wan/*', 22 | "*://*.bch/", 23 | '*://*.bch/*' 24 | ], 25 | }); -------------------------------------------------------------------------------- /src/components/Content.vue: -------------------------------------------------------------------------------- 1 | 11 | 56 | -------------------------------------------------------------------------------- /src/components/Error.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 33 | 34 | 96 | -------------------------------------------------------------------------------- /src/components/Header.vue: -------------------------------------------------------------------------------- 1 | 8 | 38 | -------------------------------------------------------------------------------- /src/components/IconItem.vue: -------------------------------------------------------------------------------- 1 | 9 | 23 | 66 | -------------------------------------------------------------------------------- /src/components/Loading.vue: -------------------------------------------------------------------------------- 1 | 70 | 75 | 104 | 105 | -------------------------------------------------------------------------------- /src/components/Popup.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 21 | 22 | -------------------------------------------------------------------------------- /src/components/Powered.vue: -------------------------------------------------------------------------------- 1 | 4 | 19 | -------------------------------------------------------------------------------- /src/components/not404.vue: -------------------------------------------------------------------------------- 1 | 6 | 18 | -------------------------------------------------------------------------------- /src/error.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import ErrorPage from 'Error.vue'; 3 | import './scss/global/global.scss'; 4 | new Vue({ 5 | el: '#app', 6 | render: h=>h(ErrorPage), 7 | }); -------------------------------------------------------------------------------- /src/images/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/.DS_Store -------------------------------------------------------------------------------- /src/images/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/404.png -------------------------------------------------------------------------------- /src/images/Assets/Browser extension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/Assets/Browser extension.png -------------------------------------------------------------------------------- /src/images/Assets/black/yellow eyes.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | yellow eyes 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/images/Assets/black/yellow eyes@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/Assets/black/yellow eyes@2x.png -------------------------------------------------------------------------------- /src/images/Assets/blocks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/Assets/blocks.png -------------------------------------------------------------------------------- /src/images/Assets/blocks.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Group 2 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/images/Assets/blocks@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/Assets/blocks@2x.png -------------------------------------------------------------------------------- /src/images/Assets/etc.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | etc 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/images/Assets/etc@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/Assets/etc@2x.png -------------------------------------------------------------------------------- /src/images/Assets/eth.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | eth 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/images/Assets/eth@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/Assets/eth@2x.png -------------------------------------------------------------------------------- /src/images/Assets/extensionlogo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Group 50 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/images/Assets/extensionlogo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/Assets/extensionlogo@2x.png -------------------------------------------------------------------------------- /src/images/Assets/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | icon 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/images/Assets/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/Assets/icon@2x.png -------------------------------------------------------------------------------- /src/images/Assets/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | link 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/images/Assets/link@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/Assets/link@2x.png -------------------------------------------------------------------------------- /src/images/Assets/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | logo 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/images/Assets/logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/Assets/logo@2x.png -------------------------------------------------------------------------------- /src/images/Assets/qtum.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | qtum 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/images/Assets/qtum@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/Assets/qtum@2x.png -------------------------------------------------------------------------------- /src/images/Assets/wan.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | wan 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/images/Assets/wan@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/Assets/wan@2x.png -------------------------------------------------------------------------------- /src/images/Browser extension elephant-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/Browser extension elephant-04.png -------------------------------------------------------------------------------- /src/images/Browser extension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/Browser extension.png -------------------------------------------------------------------------------- /src/images/ChromeStore/arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | arrow 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/images/ChromeStore/arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/ChromeStore/arrow@2x.png -------------------------------------------------------------------------------- /src/images/ChromeStore/bg@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/ChromeStore/bg@2x.png -------------------------------------------------------------------------------- /src/images/ChromeStore/bg_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/ChromeStore/bg_2.png -------------------------------------------------------------------------------- /src/images/ChromeStore/bg_2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | store search result copy 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/images/ChromeStore/bg_3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | bg_3 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/images/ChromeStore/bg_3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/ChromeStore/bg_3@2x.png -------------------------------------------------------------------------------- /src/images/ChromeStore/extension_logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | extension logo 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/images/ChromeStore/extension_logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/ChromeStore/extension_logo@2x.png -------------------------------------------------------------------------------- /src/images/ChromeStore/extension_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/ChromeStore/extension_page.png -------------------------------------------------------------------------------- /src/images/ChromeStore/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/ChromeStore/logo.png -------------------------------------------------------------------------------- /src/images/ChromeStore/store_search_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/ChromeStore/store_search_result.png -------------------------------------------------------------------------------- /src/images/ChromeStore/te.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | te 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/images/ChromeStore/te@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/ChromeStore/te@2x.png -------------------------------------------------------------------------------- /src/images/deadface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/deadface.png -------------------------------------------------------------------------------- /src/images/loginglogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/loginglogo.png -------------------------------------------------------------------------------- /src/images/loginglogo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | logo2 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/logo.png -------------------------------------------------------------------------------- /src/images/logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/logo2.png -------------------------------------------------------------------------------- /src/images/pwlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/images/pwlogo.png -------------------------------------------------------------------------------- /src/lib/Registrar/index.js: -------------------------------------------------------------------------------- 1 | import Web3 from "web3"; 2 | import multihash from "multihashes"; 3 | import Promises from 'bluebird'; 4 | import namehash from "eth-ens-namehash"; 5 | import registry from "../abi/registry.js"; 6 | import resolver from "../abi/resolver.js"; 7 | const abi = { registry, resolver }; 8 | const ENS_HttpProvider = "https://mainnet.infura.io/"; 9 | const ECNS_HttpProvider = "https://etc-parity.0xinfra.com"; 10 | const WNS_HttpProvider = "http://wanchain.portal.network"; 11 | const REGISTRY_ENS_MAIN_NET = "0x314159265dd8dbb310642f98f50c066173c1259b"; 12 | const REGISTRY_ECNS_MAIN_NET = "0xb96836a066ef81ea038280c733f833f69c23efde"; 13 | const REGISTRY_WNS_MAIN_NET = "0xee8d418fd33e69782015ea4313dfd8eb7b1b91ce"; 14 | export const BNS = (name, tldidx)=> { 15 | 16 | const ProviderArr = [ 17 | ENS_HttpProvider, 18 | ECNS_HttpProvider, 19 | WNS_HttpProvider 20 | ]; 21 | const RegistrarArr = [ 22 | REGISTRY_ENS_MAIN_NET, 23 | REGISTRY_ECNS_MAIN_NET, 24 | REGISTRY_WNS_MAIN_NET 25 | ]; 26 | const web3 = new Web3(new Web3.providers.HttpProvider(ProviderArr[tldidx])); 27 | const hash = namehash.hash(name); 28 | const Registry = new web3.eth.Contract(abi.registry, RegistrarArr[tldidx]); 29 | let isMultihash = false; 30 | return new Promise((resolve, reject) => { 31 | Registry.methods.resolver(hash).call() 32 | .then(async address => { 33 | if (address === '0x0000000000000000000000000000000000000000') return reject(null); 34 | const Resolver = new web3.eth.Contract(abi.resolver, address); 35 | isMultihash = await Resolver.methods.supportsInterface('0xe89401a1').call(); 36 | if(isMultihash){ 37 | const mHash = await Resolver.methods.multihash(hash).call(); 38 | if (mHash === '0x') return Promises.resolve(mHash); 39 | return Promises.resolve(mHash); 40 | }else{ 41 | return Resolver.methods.content(hash).call(); 42 | } 43 | }) 44 | .then(contentHash => { 45 | if (contentHash === '0x0000000000000000000000000000000000000000000000000000000000000000') reject(null); 46 | if (contentHash) { 47 | const hex = contentHash.substring(2); 48 | const buf = multihash.fromHexString(hex); 49 | const toB58String = multihash.toB58String(buf); 50 | const toEncode = multihash.toB58String(multihash.encode(buf, 'sha2-256')); 51 | resolve(isMultihash ? toB58String : toEncode); 52 | } else { 53 | reject(null) 54 | } 55 | }) 56 | }) 57 | } 58 | -------------------------------------------------------------------------------- /src/lib/abi/registry.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | "constant": true, 4 | "inputs": [ 5 | { 6 | "name": "node", 7 | "type": "bytes32" 8 | } 9 | ], 10 | "name": "resolver", 11 | "outputs": [ 12 | { 13 | "name": "", 14 | "type": "address" 15 | } 16 | ], 17 | "payable": false, 18 | "type": "function" 19 | }, 20 | { 21 | "constant": true, 22 | "inputs": [ 23 | { 24 | "name": "node", 25 | "type": "bytes32" 26 | } 27 | ], 28 | "name": "owner", 29 | "outputs": [ 30 | { 31 | "name": "", 32 | "type": "address" 33 | } 34 | ], 35 | "payable": false, 36 | "type": "function" 37 | }, 38 | { 39 | "constant": false, 40 | "inputs": [ 41 | { 42 | "name": "node", 43 | "type": "bytes32" 44 | }, 45 | { 46 | "name": "label", 47 | "type": "bytes32" 48 | }, 49 | { 50 | "name": "owner", 51 | "type": "address" 52 | } 53 | ], 54 | "name": "setSubnodeOwner", 55 | "outputs": [], 56 | "payable": false, 57 | "type": "function" 58 | }, 59 | { 60 | "constant": false, 61 | "inputs": [ 62 | { 63 | "name": "node", 64 | "type": "bytes32" 65 | }, 66 | { 67 | "name": "ttl", 68 | "type": "uint64" 69 | } 70 | ], 71 | "name": "setTTL", 72 | "outputs": [], 73 | "payable": false, 74 | "type": "function" 75 | }, 76 | { 77 | "constant": true, 78 | "inputs": [ 79 | { 80 | "name": "node", 81 | "type": "bytes32" 82 | } 83 | ], 84 | "name": "ttl", 85 | "outputs": [ 86 | { 87 | "name": "", 88 | "type": "uint64" 89 | } 90 | ], 91 | "payable": false, 92 | "type": "function" 93 | }, 94 | { 95 | "constant": false, 96 | "inputs": [ 97 | { 98 | "name": "node", 99 | "type": "bytes32" 100 | }, 101 | { 102 | "name": "resolver", 103 | "type": "address" 104 | } 105 | ], 106 | "name": "setResolver", 107 | "outputs": [], 108 | "payable": false, 109 | "type": "function" 110 | }, 111 | { 112 | "constant": false, 113 | "inputs": [ 114 | { 115 | "name": "node", 116 | "type": "bytes32" 117 | }, 118 | { 119 | "name": "owner", 120 | "type": "address" 121 | } 122 | ], 123 | "name": "setOwner", 124 | "outputs": [], 125 | "payable": false, 126 | "type": "function" 127 | }, 128 | { 129 | "anonymous": false, 130 | "inputs": [ 131 | { 132 | "indexed": true, 133 | "name": "node", 134 | "type": "bytes32" 135 | }, 136 | { 137 | "indexed": false, 138 | "name": "owner", 139 | "type": "address" 140 | } 141 | ], 142 | "name": "Transfer", 143 | "type": "event" 144 | }, 145 | { 146 | "anonymous": false, 147 | "inputs": [ 148 | { 149 | "indexed": true, 150 | "name": "node", 151 | "type": "bytes32" 152 | }, 153 | { 154 | "indexed": true, 155 | "name": "label", 156 | "type": "bytes32" 157 | }, 158 | { 159 | "indexed": false, 160 | "name": "owner", 161 | "type": "address" 162 | } 163 | ], 164 | "name": "NewOwner", 165 | "type": "event" 166 | }, 167 | { 168 | "anonymous": false, 169 | "inputs": [ 170 | { 171 | "indexed": true, 172 | "name": "node", 173 | "type": "bytes32" 174 | }, 175 | { 176 | "indexed": false, 177 | "name": "resolver", 178 | "type": "address" 179 | } 180 | ], 181 | "name": "NewResolver", 182 | "type": "event" 183 | }, 184 | { 185 | "anonymous": false, 186 | "inputs": [ 187 | { 188 | "indexed": true, 189 | "name": "node", 190 | "type": "bytes32" 191 | }, 192 | { 193 | "indexed": false, 194 | "name": "ttl", 195 | "type": "uint64" 196 | } 197 | ], 198 | "name": "NewTTL", 199 | "type": "event" 200 | } 201 | ] -------------------------------------------------------------------------------- /src/lib/abi/resolver.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | constant: true, 4 | inputs: [ 5 | { 6 | name: 'interfaceID', 7 | type: 'bytes4', 8 | }, 9 | ], 10 | name: 'supportsInterface', 11 | outputs: [ 12 | { 13 | name: '', 14 | type: 'bool', 15 | }, 16 | ], 17 | payable: false, 18 | type: 'function', 19 | }, { 20 | constant: true, 21 | inputs: [ 22 | { 23 | name: 'node', 24 | type: 'bytes32', 25 | }, { 26 | name: 'contentTypes', 27 | type: 'uint256', 28 | }, 29 | ], 30 | name: 'ABI', 31 | outputs: [ 32 | { 33 | name: 'contentType', 34 | type: 'uint256', 35 | }, { 36 | name: 'data', 37 | type: 'bytes', 38 | }, 39 | ], 40 | payable: false, 41 | type: 'function', 42 | }, { 43 | constant: false, 44 | inputs: [ 45 | { 46 | name: 'node', 47 | type: 'bytes32', 48 | }, { 49 | name: 'x', 50 | type: 'bytes32', 51 | }, { 52 | name: 'y', 53 | type: 'bytes32', 54 | }, 55 | ], 56 | name: 'setPubkey', 57 | outputs: [], 58 | payable: false, 59 | type: 'function', 60 | }, { 61 | constant: true, 62 | inputs: [ 63 | { 64 | name: 'node', 65 | type: 'bytes32', 66 | }, 67 | ], 68 | name: 'content', 69 | outputs: [ 70 | { 71 | name: 'ret', 72 | type: 'bytes32', 73 | }, 74 | ], 75 | payable: false, 76 | type: 'function', 77 | }, { 78 | constant: true, 79 | inputs: [ 80 | { 81 | name: 'node', 82 | type: 'bytes32', 83 | }, 84 | ], 85 | name: 'multihash', 86 | outputs: [ 87 | { 88 | name: 'ret', 89 | type: 'bytes', 90 | }, 91 | ], 92 | payable: false, 93 | type: 'function', 94 | }, { 95 | constant: true, 96 | inputs: [ 97 | { 98 | name: 'node', 99 | type: 'bytes32', 100 | }, 101 | ], 102 | name: 'addr', 103 | outputs: [ 104 | { 105 | name: 'ret', 106 | type: 'address', 107 | }, 108 | ], 109 | payable: false, 110 | type: 'function', 111 | }, { 112 | constant: false, 113 | inputs: [ 114 | { 115 | name: 'node', 116 | type: 'bytes32', 117 | }, { 118 | name: 'contentType', 119 | type: 'uint256', 120 | }, { 121 | name: 'data', 122 | type: 'bytes', 123 | }, 124 | ], 125 | name: 'setABI', 126 | outputs: [], 127 | payable: false, 128 | type: 'function', 129 | }, { 130 | constant: true, 131 | inputs: [ 132 | { 133 | name: 'node', 134 | type: 'bytes32', 135 | }, 136 | ], 137 | name: 'name', 138 | outputs: [ 139 | { 140 | name: 'ret', 141 | type: 'string', 142 | }, 143 | ], 144 | payable: false, 145 | type: 'function', 146 | }, { 147 | constant: false, 148 | inputs: [ 149 | { 150 | name: 'node', 151 | type: 'bytes32', 152 | }, { 153 | name: 'hash', 154 | type: 'bytes', 155 | }, 156 | ], 157 | name: 'setMultihash', 158 | outputs: [], 159 | payable: false, 160 | type: 'function', 161 | }, { 162 | constant: false, 163 | inputs: [ 164 | { 165 | name: 'node', 166 | type: 'bytes32', 167 | }, { 168 | name: 'name', 169 | type: 'string', 170 | }, 171 | ], 172 | name: 'setName', 173 | outputs: [], 174 | payable: false, 175 | type: 'function', 176 | }, { 177 | constant: false, 178 | inputs: [ 179 | { 180 | name: 'node', 181 | type: 'bytes32', 182 | }, { 183 | name: 'hash', 184 | type: 'bytes32', 185 | }, 186 | ], 187 | name: 'setContent', 188 | outputs: [], 189 | payable: false, 190 | type: 'function', 191 | }, { 192 | constant: true, 193 | inputs: [ 194 | { 195 | name: 'node', 196 | type: 'bytes32', 197 | }, 198 | ], 199 | name: 'pubkey', 200 | outputs: [ 201 | { 202 | name: 'x', 203 | type: 'bytes32', 204 | }, { 205 | name: 'y', 206 | type: 'bytes32', 207 | }, 208 | ], 209 | payable: false, 210 | type: 'function', 211 | }, { 212 | constant: false, 213 | inputs: [ 214 | { 215 | name: 'node', 216 | type: 'bytes32', 217 | }, { 218 | name: 'addr', 219 | type: 'address', 220 | }, 221 | ], 222 | name: 'setAddr', 223 | outputs: [], 224 | payable: false, 225 | type: 'function', 226 | }, { 227 | inputs: [ 228 | { 229 | name: 'ensAddr', 230 | type: 'address', 231 | }, 232 | ], 233 | payable: false, 234 | type: 'constructor', 235 | }, { 236 | anonymous: false, 237 | inputs: [ 238 | { 239 | indexed: true, 240 | name: 'node', 241 | type: 'bytes32', 242 | }, { 243 | indexed: false, 244 | name: 'a', 245 | type: 'address', 246 | }, 247 | ], 248 | name: 'AddrChanged', 249 | type: 'event', 250 | }, { 251 | anonymous: false, 252 | inputs: [ 253 | { 254 | indexed: true, 255 | name: 'node', 256 | type: 'bytes32', 257 | }, { 258 | indexed: false, 259 | name: 'hash', 260 | type: 'bytes32', 261 | }, 262 | ], 263 | name: 'ContentChanged', 264 | type: 'event', 265 | }, { 266 | anonymous: false, 267 | inputs: [ 268 | { 269 | indexed: true, 270 | name: 'node', 271 | type: 'bytes32', 272 | }, { 273 | indexed: false, 274 | name: 'name', 275 | type: 'string', 276 | }, 277 | ], 278 | name: 'NameChanged', 279 | type: 'event', 280 | }, { 281 | anonymous: false, 282 | inputs: [ 283 | { 284 | indexed: true, 285 | name: 'node', 286 | type: 'bytes32', 287 | }, { 288 | indexed: true, 289 | name: 'contentType', 290 | type: 'uint256', 291 | }, 292 | ], 293 | name: 'ABIChanged', 294 | type: 'event', 295 | }, { 296 | anonymous: false, 297 | inputs: [ 298 | { 299 | indexed: true, 300 | name: 'node', 301 | type: 'bytes32', 302 | }, { 303 | indexed: false, 304 | name: 'x', 305 | type: 'bytes32', 306 | }, { 307 | indexed: false, 308 | name: 'y', 309 | type: 'bytes32', 310 | }, 311 | ], 312 | name: 'PubkeyChanged', 313 | type: 'event', 314 | }, { 315 | anonymous: false, 316 | inputs: [ 317 | { 318 | indexed: true, 319 | name: 'node', 320 | type: 'bytes32', 321 | }, { 322 | indexed: false, 323 | name: 'hash', 324 | type: 'bytes', 325 | }, 326 | ], 327 | name: 'MultihashChanged', 328 | type: 'event', 329 | }, 330 | ] 331 | -------------------------------------------------------------------------------- /src/lib/resolver.js: -------------------------------------------------------------------------------- 1 | import { BNS } from "./Registrar"; 2 | const BCNS_API_URL = 'http://bcns-rest.herokuapp.com/v1/dataRetrieval/BCNS/resolution/multihash'; 3 | const TLD_LIST = ['eth', 'etc', 'wan']; 4 | 5 | 6 | export default (name) => { 7 | const extractDomain = name.split("."); 8 | const tld = extractDomain.pop(); 9 | const label = extractDomain.shift(); 10 | 11 | switch (tld) { 12 | case 'eth': 13 | case 'etc': 14 | case 'wan': 15 | const providerIndex = TLD_LIST.indexOf(tld); 16 | return BNS(name, providerIndex); 17 | break; 18 | case 'bch': 19 | const result = fetch(`${BCNS_API_URL}?domain=${label}`) 20 | .then(response => { 21 | if (response.ok) { 22 | return response.json() 23 | } 24 | return new Promise((resolve, reject) => reject(null)); 25 | }) 26 | .catch(error => new Promise((resolve, reject) => reject(null))) 27 | .then(result => new Promise((resolve, reject) => resolve(result.multihash))); 28 | return result; 29 | break; 30 | default: 31 | return new Promise((resolve, reject) => reject(null)); 32 | break; 33 | } 34 | } -------------------------------------------------------------------------------- /src/loading.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Loading from 'Loading.vue'; 3 | import './scss/global/global.scss'; 4 | new Vue({ 5 | el: '#app', 6 | render: h=>h(Loading), 7 | }); -------------------------------------------------------------------------------- /src/not404.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import not404 from 'not404.vue'; 3 | import './scss/global/global.scss'; 4 | new Vue({ 5 | el: '#app', 6 | render: h=>h(not404), 7 | }); -------------------------------------------------------------------------------- /src/popup.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Popup from 'Popup.vue'; 3 | import './scss/global/pop.scss'; 4 | new Vue({ 5 | el: '#app', 6 | render: h=>h(Popup), 7 | }); -------------------------------------------------------------------------------- /src/scss/global/_mixin.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortalNetwork/portal-network-browser-extension/051efa5d96c1a0f34b781725ad09921dccd8e58c/src/scss/global/_mixin.scss -------------------------------------------------------------------------------- /src/scss/global/_reset.scss: -------------------------------------------------------------------------------- 1 | /*! normalize.css v3.0.2 | MIT License | git.io/normalize */ 2 | 3 | /** 4 | * 1. Set default font family to sans-serif. 5 | * 2. Prevent iOS text size adjust after orientation change, without disabling 6 | * user zoom. 7 | */ 8 | 9 | html { 10 | font-family: sans-serif; /* 1 */ 11 | -ms-text-size-adjust: 100%; /* 2 */ 12 | -webkit-text-size-adjust: 100%; /* 2 */ 13 | } 14 | 15 | /** 16 | * Remove default margin. 17 | */ 18 | 19 | body { 20 | margin: 0; 21 | } 22 | 23 | /* HTML5 display definitions 24 | ========================================================================== */ 25 | 26 | /** 27 | * Correct `block` display not defined for any HTML5 element in IE 8/9. 28 | * Correct `block` display not defined for `details` or `summary` in IE 10/11 29 | * and Firefox. 30 | * Correct `block` display not defined for `main` in IE 11. 31 | */ 32 | 33 | article, 34 | aside, 35 | details, 36 | figcaption, 37 | figure, 38 | footer, 39 | header, 40 | hgroup, 41 | main, 42 | menu, 43 | nav, 44 | section, 45 | summary { 46 | display: block; 47 | } 48 | 49 | /** 50 | * 1. Correct `inline-block` display not defined in IE 8/9. 51 | * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. 52 | */ 53 | 54 | audio, 55 | canvas, 56 | progress, 57 | video { 58 | display: inline-block; /* 1 */ 59 | vertical-align: baseline; /* 2 */ 60 | } 61 | 62 | /** 63 | * Prevent modern browsers from displaying `audio` without controls. 64 | * Remove excess height in iOS 5 devices. 65 | */ 66 | 67 | audio:not([controls]) { 68 | display: none; 69 | height: 0; 70 | } 71 | 72 | /** 73 | * Address `[hidden]` styling not present in IE 8/9/10. 74 | * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. 75 | */ 76 | 77 | [hidden], 78 | template { 79 | display: none; 80 | } 81 | 82 | /* Links 83 | ========================================================================== */ 84 | 85 | /** 86 | * Remove the gray background color from active links in IE 10. 87 | */ 88 | 89 | a { 90 | background-color: transparent; 91 | text-decoration: none; 92 | } 93 | 94 | /** 95 | * Improve readability when focused and also mouse hovered in all browsers. 96 | */ 97 | 98 | a:active, 99 | a:hover { 100 | outline: 0; 101 | } 102 | 103 | /* Text-level semantics 104 | ========================================================================== */ 105 | 106 | /** 107 | * Address styling not present in IE 8/9/10/11, Safari, and Chrome. 108 | */ 109 | 110 | abbr[title] { 111 | border-bottom: 1px dotted; 112 | } 113 | 114 | /** 115 | * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. 116 | */ 117 | 118 | b, 119 | strong { 120 | font-weight: bold; 121 | } 122 | 123 | /** 124 | * Address styling not present in Safari and Chrome. 125 | */ 126 | 127 | dfn { 128 | font-style: italic; 129 | } 130 | 131 | /** 132 | * Address variable `h1` font-size and margin within `section` and `article` 133 | * contexts in Firefox 4+, Safari, and Chrome. 134 | */ 135 | 136 | h1 { 137 | font-size: 2em; 138 | margin: 0em 0; 139 | } 140 | 141 | /** 142 | * Address styling not present in IE 8/9. 143 | */ 144 | 145 | mark { 146 | background: #ff0; 147 | color: #000; 148 | } 149 | 150 | /** 151 | * Address inconsistent and variable font size in all browsers. 152 | */ 153 | 154 | small { 155 | font-size: 80%; 156 | } 157 | 158 | /** 159 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 160 | */ 161 | 162 | sub, 163 | sup { 164 | font-size: 75%; 165 | line-height: 0; 166 | position: relative; 167 | vertical-align: baseline; 168 | } 169 | 170 | sup { 171 | top: -0.5em; 172 | } 173 | 174 | sub { 175 | bottom: -0.25em; 176 | } 177 | 178 | /* Embedded content 179 | ========================================================================== */ 180 | 181 | /** 182 | * Remove border when inside `a` element in IE 8/9/10. 183 | */ 184 | 185 | img { 186 | border: 0; 187 | } 188 | 189 | /** 190 | * Correct overflow not hidden in IE 9/10/11. 191 | */ 192 | 193 | svg:not(:root) { 194 | overflow: hidden; 195 | } 196 | 197 | /* Grouping content 198 | ========================================================================== */ 199 | 200 | /** 201 | * Address margin not present in IE 8/9 and Safari. 202 | */ 203 | 204 | figure { 205 | margin: 1em 40px; 206 | } 207 | 208 | /** 209 | * Address differences between Firefox and other browsers. 210 | */ 211 | 212 | hr { 213 | -moz-box-sizing: content-box; 214 | box-sizing: content-box; 215 | height: 0; 216 | } 217 | 218 | /** 219 | * Contain overflow in all browsers. 220 | */ 221 | 222 | pre { 223 | overflow: auto; 224 | } 225 | 226 | /** 227 | * Address odd `em`-unit font size rendering in all browsers. 228 | */ 229 | 230 | code, 231 | kbd, 232 | pre, 233 | samp { 234 | font-family: monospace, monospace; 235 | font-size: 1em; 236 | } 237 | 238 | /* Forms 239 | ========================================================================== */ 240 | 241 | /** 242 | * Known limitation: by default, Chrome and Safari on OS X allow very limited 243 | * styling of `select`, unless a `border` property is set. 244 | */ 245 | 246 | /** 247 | * 1. Correct color not being inherited. 248 | * Known issue: affects color of disabled elements. 249 | * 2. Correct font properties not being inherited. 250 | * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. 251 | */ 252 | 253 | button, 254 | input, 255 | optgroup, 256 | select, 257 | textarea { 258 | color: inherit; /* 1 */ 259 | font: inherit; /* 2 */ 260 | margin: 0; /* 3 */ 261 | } 262 | 263 | /** 264 | * Address `overflow` set to `hidden` in IE 8/9/10/11. 265 | */ 266 | 267 | button { 268 | overflow: visible; 269 | } 270 | 271 | /** 272 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 273 | * All other form control elements do not inherit `text-transform` values. 274 | * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. 275 | * Correct `select` style inheritance in Firefox. 276 | */ 277 | 278 | button, 279 | select { 280 | text-transform: none; 281 | } 282 | 283 | /** 284 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 285 | * and `video` controls. 286 | * 2. Correct inability to style clickable `input` types in iOS. 287 | * 3. Improve usability and consistency of cursor style between image-type 288 | * `input` and others. 289 | */ 290 | 291 | button, 292 | html input[type="button"], /* 1 */ 293 | input[type="reset"], 294 | input[type="submit"] { 295 | -webkit-appearance: button; /* 2 */ 296 | cursor: pointer; /* 3 */ 297 | } 298 | 299 | /** 300 | * Re-set default cursor for disabled elements. 301 | */ 302 | 303 | button[disabled], 304 | html input[disabled] { 305 | cursor: default; 306 | } 307 | 308 | /** 309 | * Remove inner padding and border in Firefox 4+. 310 | */ 311 | 312 | button::-moz-focus-inner, 313 | input::-moz-focus-inner { 314 | border: 0; 315 | padding: 0; 316 | } 317 | 318 | /** 319 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 320 | * the UA stylesheet. 321 | */ 322 | 323 | input { 324 | line-height: normal; 325 | } 326 | 327 | /** 328 | * It's recommended that you don't attempt to style these elements. 329 | * Firefox's implementation doesn't respect box-sizing, padding, or width. 330 | * 331 | * 1. Address box sizing set to `content-box` in IE 8/9/10. 332 | * 2. Remove excess padding in IE 8/9/10. 333 | */ 334 | 335 | input[type="checkbox"], 336 | input[type="radio"] { 337 | box-sizing: border-box; /* 1 */ 338 | padding: 0; /* 2 */ 339 | } 340 | 341 | /** 342 | * Fix the cursor style for Chrome's increment/decrement buttons. For certain 343 | * `font-size` values of the `input`, it causes the cursor style of the 344 | * decrement button to change from `default` to `text`. 345 | */ 346 | 347 | input[type="number"]::-webkit-inner-spin-button, 348 | input[type="number"]::-webkit-outer-spin-button { 349 | height: auto; 350 | } 351 | 352 | /** 353 | * 1. Address `appearance` set to `searchfield` in Safari and Chrome. 354 | * 2. Address `box-sizing` set to `border-box` in Safari and Chrome 355 | * (include `-moz` to future-proof). 356 | */ 357 | 358 | input[type="search"] { 359 | -webkit-appearance: textfield; /* 1 */ 360 | -moz-box-sizing: content-box; 361 | -webkit-box-sizing: content-box; /* 2 */ 362 | box-sizing: content-box; 363 | } 364 | 365 | /** 366 | * Remove inner padding and search cancel button in Safari and Chrome on OS X. 367 | * Safari (but not Chrome) clips the cancel button when the search input has 368 | * padding (and `textfield` appearance). 369 | */ 370 | 371 | input[type="search"]::-webkit-search-cancel-button, 372 | input[type="search"]::-webkit-search-decoration { 373 | -webkit-appearance: none; 374 | } 375 | 376 | /** 377 | * Define consistent border, margin, and padding. 378 | */ 379 | 380 | fieldset { 381 | border: 1px solid #c0c0c0; 382 | margin: 0 2px; 383 | padding: 0.35em 0.625em 0.75em; 384 | } 385 | 386 | /** 387 | * 1. Correct `color` not being inherited in IE 8/9/10/11. 388 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 389 | */ 390 | 391 | legend { 392 | border: 0; /* 1 */ 393 | padding: 0; /* 2 */ 394 | } 395 | 396 | /** 397 | * Remove default vertical scrollbar in IE 8/9/10/11. 398 | */ 399 | 400 | textarea { 401 | overflow: auto; 402 | } 403 | 404 | /** 405 | * Don't inherit the `font-weight` (applied by a rule above). 406 | * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. 407 | */ 408 | 409 | optgroup { 410 | font-weight: bold; 411 | } 412 | 413 | /* Tables 414 | ========================================================================== */ 415 | 416 | /** 417 | * Remove most spacing between table cells. 418 | */ 419 | 420 | table { 421 | border-collapse: collapse; 422 | border-spacing: 0; 423 | } 424 | 425 | td, 426 | th { 427 | padding: 0; 428 | } 429 | ol, ul { 430 | list-style: none; 431 | } -------------------------------------------------------------------------------- /src/scss/global/global.scss: -------------------------------------------------------------------------------- 1 | @import '_reset.scss'; 2 | @import '_mixin.scss'; 3 | *{ 4 | box-sizing:border-box; 5 | margin: 0; 6 | padding: 0; 7 | } 8 | a,h1,h2,h3,h4,h5,h6,span,p,a,input,button,div,span{ 9 | font-family: "Microsoft JhengHei","Heiti TC","sans-serif"; 10 | text-decoration: none; 11 | } 12 | img{ 13 | display: block; 14 | } 15 | html,body{ 16 | width: 100%; 17 | height: 100%; 18 | } 19 | a{ 20 | cursor: pointer; 21 | } -------------------------------------------------------------------------------- /src/scss/global/pop.scss: -------------------------------------------------------------------------------- 1 | @import '_reset.scss'; 2 | @import '_mixin.scss'; 3 | *{ 4 | box-sizing:border-box; 5 | margin: 0; 6 | padding: 0; 7 | } 8 | a,h1,h2,h3,h4,h5,h6,span,p,a,input,button,div,span{ 9 | font-family: "Microsoft JhengHei","Heiti TC","sans-serif"; 10 | text-decoration: none; 11 | } 12 | img{ 13 | display: block; 14 | } 15 | html,body{ 16 | width: 100%; 17 | height: 600px; 18 | overflow: auto; 19 | background-color: #0042b4; 20 | } 21 | a{ 22 | cursor: pointer; 23 | } -------------------------------------------------------------------------------- /src/template/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | <%= htmlWebpackPlugin.options.title %> 8 | 9 | 10 |
11 | 12 | -------------------------------------------------------------------------------- /src/template/loading.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | <%= htmlWebpackPlugin.options.title %> 8 | 9 | 10 |
11 | 12 | -------------------------------------------------------------------------------- /src/template/popup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <%= htmlWebpackPlugin.options.title %> 6 | 7 | 8 | 9 |
10 | 11 | -------------------------------------------------------------------------------- /test/README.md: -------------------------------------------------------------------------------- 1 | # Portal Network Browser Extension 2 | 3 | ## Environment Setup 4 | ``` 5 | npm install 6 | ``` 7 | ## Test cases 8 | 9 | - Type-in Domain 10 | - [ ] `phyrextsai.eth || phyrextsai.etc || phyrextsai.wan` : able to jump to IPFS page 11 | - [ ] `phyrextsai.ethxxx` : unable to enter extension to be able to search the loading page because the wrong ltd 12 | - [ ] `abcdefghijk.eth` : enter non-existing domain and jump to page not found 13 | - [ ] multihash : search if the domain resolver has a multihash, use multimash if there's one 14 | - enter loading page 15 | - [ ] when it takes too long to load : jump to page 40 16 | - [ ] unable to find ipfs page : jump to page not found 17 | - [ ] switch to pagination while loading in progress : the original loading page will jump to the specific ipfs page instead of switch to the pagination 18 | - click link 19 | - [ ] Join Us On Telegram : jump to telegram app 20 | - [ ] twitter icon : jump to twitter website 21 | - [ ] medium icon : jump to medium website 22 | - [ ] main icon : open mail window 23 | - [ ] Powered by Portal Network : open official website 24 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const webpack = require('webpack'); 3 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 4 | const CopyWebpackPlugin = require('copy-webpack-plugin'); 5 | const VueLoaderPlugin = require('vue-loader/lib/plugin'); 6 | const config = { 7 | context: path.resolve(__dirname, 'src'), 8 | entry: { 9 | background: 'background', 10 | loading: 'loading', 11 | popup: 'popup', 12 | error: 'error', 13 | not404: 'not404' 14 | }, 15 | output: { 16 | path: path.resolve(__dirname, 'dist'), 17 | filename: '[name].js?[hash:8]', 18 | publicPath: process.env.NODE_ENV === "development" ? "/" : "./" 19 | }, 20 | resolve: { 21 | alias: { 22 | vue: process.env.NODE_ENV === "development" ? 'vue/dist/vue.js' : 'vue/dist/vue.min.js' 23 | }, 24 | modules: [ 25 | path.resolve('src'), 26 | path.resolve('src/images'), 27 | path.resolve('src/components'), 28 | path.resolve('src/assets'), 29 | path.resolve('node_modules') 30 | ], 31 | extensions: ['.js'] 32 | }, 33 | module:{ 34 | rules:[ 35 | { 36 | test: /\.(sass|scss)$/, 37 | use: [ 38 | 'vue-style-loader', 39 | 'css-loader', 40 | 'postcss-loader', 41 | { 42 | loader: 'sass-loader', 43 | 'options':{ 44 | // data: `@import "./src/scss/global/global.scss";` 45 | } 46 | } 47 | 48 | ] 49 | }, 50 | { 51 | test: /\.svg$/, 52 | use: 'vue-svg-loader', 53 | }, 54 | { 55 | test: /\.(vue)$/, 56 | use: 'vue-loader', 57 | }, 58 | { 59 | test: /\.(js)$/, 60 | use: 'babel-loader', 61 | exclude: /(node_modules)/, 62 | }, 63 | { 64 | test: /\.(jpe?g|png|gif|ico)$/, 65 | include: path.resolve('src/images'), 66 | use:[ 67 | { 68 | loader: 'url-loader', 69 | options: { 70 | limit: 3000, 71 | name:'[path][name].[ext]?[hash:8]' 72 | } 73 | }, 74 | { 75 | loader: 'image-webpack-loader', 76 | options: { 77 | mozjpeg: { 78 | progressive: true, 79 | quality: 65 80 | }, 81 | optipng: { 82 | enabled: false, 83 | }, 84 | pngquant: { 85 | quality: '65-90', 86 | speed: 4 87 | }, 88 | gifsicle: { 89 | interlaced: false, 90 | } 91 | } 92 | } 93 | ] 94 | }, 95 | { 96 | test: /\.(css)$/, 97 | use: [ 98 | 'style-loader', 99 | 'css-loader', 100 | 'postcss-loader' 101 | ] 102 | }, 103 | ] 104 | }, 105 | plugins: [ 106 | new VueLoaderPlugin(), 107 | new HtmlWebpackPlugin({ 108 | title: 'Portal Network', 109 | filename: 'popup.html', 110 | template: 'template/popup.html', 111 | chunks: [ 'popup' ], 112 | }), 113 | new HtmlWebpackPlugin({ 114 | title: 'Portal Network | loading', 115 | filename: 'loading.html', 116 | template: 'template/loading.html', 117 | chunks: [ 'loading' ], 118 | }), 119 | new HtmlWebpackPlugin({ 120 | title: 'Portal Network | Error', 121 | filename: 'error.html', 122 | template: 'template/error.html', 123 | chunks: [ 'error' ], 124 | }), 125 | new HtmlWebpackPlugin({ 126 | title: 'Portal Network | 404', 127 | filename: '404.html', 128 | template: 'template/error.html', 129 | chunks: [ 'not404' ], 130 | }), 131 | new CopyWebpackPlugin([ 132 | { from: 'assets', to: 'assets' }, 133 | { from: 'json', to: './' }, 134 | ]), 135 | new webpack.LoaderOptionsPlugin({ 136 | vue: { 137 | postcss: [require('autoprefixer')( 138 | { 139 | browsers: ['> 1%', 'last 5 versions', 'Firefox >= 45', 'iOS >=8', 'Safari >=8','ie >= 10'] 140 | } 141 | )] 142 | } 143 | }) 144 | ] 145 | }; 146 | module.exports = config; 147 | -------------------------------------------------------------------------------- /zipfile.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const archiver = require('archiver'); 3 | const output = fs.createWriteStream('dist.zip'); 4 | const archive = archiver('zip'); 5 | archive.pipe(output); 6 | archive.directory('dist/', false); 7 | archive.finalize(); --------------------------------------------------------------------------------