diff options
author | frankiebee <frankie.diamond@gmail.com> | 2017-04-03 13:01:44 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2017-04-03 13:01:44 +0800 |
commit | 8d49d519c090d287484008346aba1df6d7ad77e7 (patch) | |
tree | a4064ac0a05429c591e6776bf496c803d1819ae9 /library/src/dapp-connection.js | |
parent | 29a602a89b176e7af3f15297c2f586a4ece0a726 (diff) | |
download | tangerine-wallet-browser-8d49d519c090d287484008346aba1df6d7ad77e7.tar tangerine-wallet-browser-8d49d519c090d287484008346aba1df6d7ad77e7.tar.gz tangerine-wallet-browser-8d49d519c090d287484008346aba1df6d7ad77e7.tar.bz2 tangerine-wallet-browser-8d49d519c090d287484008346aba1df6d7ad77e7.tar.lz tangerine-wallet-browser-8d49d519c090d287484008346aba1df6d7ad77e7.tar.xz tangerine-wallet-browser-8d49d519c090d287484008346aba1df6d7ad77e7.tar.zst tangerine-wallet-browser-8d49d519c090d287484008346aba1df6d7ad77e7.zip |
Rename and move around files
Diffstat (limited to 'library/src/dapp-connection.js')
-rw-r--r-- | library/src/dapp-connection.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/library/src/dapp-connection.js b/library/src/dapp-connection.js new file mode 100644 index 000000000..30680c9d7 --- /dev/null +++ b/library/src/dapp-connection.js @@ -0,0 +1,21 @@ +const ParentStream = require('iframe-stream').ParentStream +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') + +const background = new SWcontroller({ + fileName: '/popup/sw-build.js', +}) + +const pageStream = new ParentStream() +background.on('ready', (_) => { + let swStream = SwStream({ + serviceWorker: background.controller, + context: 'dapp', + }) + pageStream.pipe(swStream).pipe(pageStream) + +}) + +background.on('error', console.error) +background.startWorker() |