aboutsummaryrefslogtreecommitdiffstats
path: root/library/popup.js
blob: f294e5c69084dd5f987ab1ad286c88934562f302 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const injectCss = require('inject-css')
const MetaMaskUiCss = require('../ui/css')
const setupIframe = require('./lib/setup-iframe.js')
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')


var css = MetaMaskUiCss()
injectCss(css)

var name = 'popup'
window.METAMASK_UI_TYPE = name

console.log('outside:open')

const background = new SWcontroller({
  fileName: '/popup/sw-build.js',
})
background.on('ready', (readSw) => {
  let swStream = SwStream({
    serviceWorker: background.controller,
  })
  startPopup(swStream)
})

background.startWorker()
console.log('hello from /library/popup.js')