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:
parent
b4e3b83f04
commit
a4cdd19843
@ -1,7 +1,7 @@
|
|||||||
const injectCss = require('inject-css')
|
const injectCss = require('inject-css')
|
||||||
const MetaMaskUiCss = require('../../ui/css')
|
const MetaMaskUiCss = require('../../ui/css')
|
||||||
const PortStream = require('./lib/port-stream.js')
|
|
||||||
const startPopup = require('./popup-core')
|
const startPopup = require('./popup-core')
|
||||||
|
const PortStream = require('./lib/port-stream.js')
|
||||||
const isPopupOrNotification = require('./lib/is-popup-or-notification')
|
const isPopupOrNotification = require('./lib/is-popup-or-notification')
|
||||||
const extension = require('./lib/extension')
|
const extension = require('./lib/extension')
|
||||||
const notification = require('./lib/notifications')
|
const notification = require('./lib/notifications')
|
||||||
|
@ -27,7 +27,7 @@ var shouldPop = false
|
|||||||
window.addEventListener('click', function(){
|
window.addEventListener('click', function(){
|
||||||
if (!shouldPop) return
|
if (!shouldPop) return
|
||||||
shouldPop = false
|
shouldPop = false
|
||||||
window.open('popup.html', '', 'width=1000')
|
window.open('http://localhost:9001/popup/popup.html', '', 'width=1000')
|
||||||
console.log('opening window...')
|
console.log('opening window...')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
19
library/popup.js
Normal file
19
library/popup.js
Normal 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)
|
@ -6,6 +6,7 @@ const path = require('path')
|
|||||||
|
|
||||||
const zeroBundle = createBundle('./index.js')
|
const zeroBundle = createBundle('./index.js')
|
||||||
const controllerBundle = createBundle('./controller.js')
|
const controllerBundle = createBundle('./controller.js')
|
||||||
|
// const popupBundle = createBundle('./popup.js')
|
||||||
const appBundle = createBundle('./example/index.js')
|
const appBundle = createBundle('./example/index.js')
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -14,6 +15,12 @@ const appBundle = createBundle('./example/index.js')
|
|||||||
|
|
||||||
const iframeServer = express()
|
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
|
// serve controller bundle
|
||||||
iframeServer.get('/controller.js', function(req, res){
|
iframeServer.get('/controller.js', function(req, res){
|
||||||
res.send(controllerBundle.latest)
|
res.send(controllerBundle.latest)
|
||||||
@ -21,8 +28,7 @@ iframeServer.get('/controller.js', function(req, res){
|
|||||||
|
|
||||||
// serve background controller
|
// serve background controller
|
||||||
iframeServer.use(express.static('./server'))
|
iframeServer.use(express.static('./server'))
|
||||||
// serve popup window
|
|
||||||
// iframeServer.use('/popup', express.static('../dist/chrome'))
|
|
||||||
|
|
||||||
iframeServer.listen('9001')
|
iframeServer.listen('9001')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user