2016-09-13 09:31:04 +02:00
|
|
|
const injectCss = require('inject-css')
|
|
|
|
const MetaMaskUiCss = require('../ui/css')
|
|
|
|
const setupIframe = require('./lib/setup-iframe.js')
|
2017-03-23 19:06:38 +01:00
|
|
|
const MetamaskInpageProvider = require('../app/scripts/lib/inpage-provider.js')
|
|
|
|
const SWcontroller = require('./sw-controller')
|
|
|
|
const SwStream = require('sw-stream/lib/sw-stream.js')
|
|
|
|
const startPopup = require('../app/scripts/popup-core')
|
2016-09-13 09:31:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
var css = MetaMaskUiCss()
|
|
|
|
injectCss(css)
|
|
|
|
|
|
|
|
var name = 'popup'
|
|
|
|
window.METAMASK_UI_TYPE = name
|
|
|
|
|
|
|
|
var iframeStream = setupIframe({
|
2017-03-10 03:24:41 +01:00
|
|
|
zeroClientProvider: 'http://localhost:9001',
|
2016-09-13 09:31:04 +02:00
|
|
|
sandboxAttributes: ['allow-scripts', 'allow-popups', 'allow-same-origin'],
|
|
|
|
container: document.body,
|
|
|
|
})
|
2017-03-23 19:06:38 +01:00
|
|
|
console.log('outside:open')
|
|
|
|
const background = new SWcontroller({
|
|
|
|
fileName: '/popup/sw-build.js',
|
|
|
|
})
|
|
|
|
background.on('ready', (readSw) => {
|
|
|
|
// var inpageProvider = new MetamaskInpageProvider(SwStream(background.controller))
|
|
|
|
// startPopup(inpageProvider)
|
|
|
|
startPopup(SwStream(background.controller))
|
|
|
|
})
|
|
|
|
background.startWorker()
|
|
|
|
console.log('hello from /library/popup.js')
|