Created
March 14, 2017 09:33
-
-
Save luisivan/80c45a5d3fddf73c23d527815c63609c to your computer and use it in GitHub Desktop.
Serving MetaMask our the metamask:// Electron custom protocol
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
// distPath can greatly vary. Just point it to where you want to serve MetaMask's build files | |
protocol.registerFileProtocol('metamask', (req, cb) => { | |
const filePath = req.url.replace('metamask://app/', '') | |
const distPath = (process.defaultApp) ? `${url.resolve(__dirname, '.metamask')}/dist/chrome/${filePath}` : path.resolve(`${__dirname}/metamask/${filePath}`) | |
cb({ path: distPath }) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment