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

mascara - everything but the popup bundle

This commit is contained in:
kumavis 2016-09-13 00:31:04 -07:00
parent b4e3b83f04
commit a4cdd19843
4 changed files with 29 additions and 4 deletions

View File

@ -1,7 +1,7 @@
const injectCss = require('inject-css')
const MetaMaskUiCss = require('../../ui/css')
const PortStream = require('./lib/port-stream.js')
const startPopup = require('./popup-core')
const PortStream = require('./lib/port-stream.js')
const isPopupOrNotification = require('./lib/is-popup-or-notification')
const extension = require('./lib/extension')
const notification = require('./lib/notifications')

View File

@ -27,7 +27,7 @@ var shouldPop = false
window.addEventListener('click', function(){
if (!shouldPop) return
shouldPop = false
window.open('popup.html', '', 'width=1000')
window.open('http://localhost:9001/popup/popup.html', '', 'width=1000')
console.log('opening window...')
})

19
library/popup.js Normal file
View File

@ -0,0 +1,19 @@
const injectCss = require('inject-css')
const MetaMaskUiCss = require('../ui/css')
const startPopup = require('../app/scripts/popup-core')
const setupIframe = require('./lib/setup-iframe.js')
var css = MetaMaskUiCss()
injectCss(css)
var name = 'popup'
window.METAMASK_UI_TYPE = name
var iframeStream = setupIframe({
zeroClientProvider: 'http://127.0.0.1:9001',
sandboxAttributes: ['allow-scripts', 'allow-popups', 'allow-same-origin'],
container: document.body,
})
startPopup(iframeStream)

View File

@ -6,6 +6,7 @@ const path = require('path')
const zeroBundle = createBundle('./index.js')
const controllerBundle = createBundle('./controller.js')
// const popupBundle = createBundle('./popup.js')
const appBundle = createBundle('./example/index.js')
//
@ -14,6 +15,12 @@ const appBundle = createBundle('./example/index.js')
const iframeServer = express()
// serve popup window
// iframeServer.get('/popup/scripts/popup.js', function(req, res){
// res.send(popupBundle.latest)
// })
iframeServer.use('/popup', express.static('../dist/chrome'))
// serve controller bundle
iframeServer.get('/controller.js', function(req, res){
res.send(controllerBundle.latest)
@ -21,8 +28,7 @@ iframeServer.get('/controller.js', function(req, res){
// serve background controller
iframeServer.use(express.static('./server'))
// serve popup window
// iframeServer.use('/popup', express.static('../dist/chrome'))
iframeServer.listen('9001')