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

22 lines
612 B
JavaScript
Raw Normal View History

const ParentStream = require('iframe-stream').ParentStream
2017-04-03 07:01:44 +02:00
const SWcontroller = require('client-sw-ready-event/lib/sw-client.js')
const SwStream = require('sw-stream/lib/sw-stream.js')
const SetupUntrustedComunication = ('./lib/setup-untrusted-connection.js')
2017-04-03 07:01:44 +02:00
const background = new SWcontroller({
fileName: '/background.js',
})
const pageStream = new ParentStream()
background.on('ready', (_) => {
let swStream = SwStream({
serviceWorker: background.controller,
context: 'dapp',
})
pageStream.pipe(swStream).pipe(pageStream)
2017-03-30 20:28:22 +02:00
})
background.on('error', console.error)
background.startWorker()