From 9f3445252c766053b7a773d75dceb1c1bbfdc6f5 Mon Sep 17 00:00:00 2001 From: frankiebee Date: Thu, 9 Mar 2017 18:24:41 -0800 Subject: put background in service worker --- library/controller.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'library/controller.js') diff --git a/library/controller.js b/library/controller.js index 5823287cc..ba97da93c 100644 --- a/library/controller.js +++ b/library/controller.js @@ -1,3 +1,4 @@ +/* const urlUtil = require('url') const extend = require('xtend') const Dnode = require('dnode') @@ -157,3 +158,24 @@ function initializeZeroClient() { } } + +*/ +const SWcontroller = require('./sw-controller') +console.log('outside:open') +const background = new SWcontroller({ + fileName: 'sw-build.js', + registerOpts: { + scope: './', + } +}) + +background.startWorker() +.then(registerdWorker => { + return background.sendMessage('connect') +}) +.then((port) => { + debugger +}) +.catch(err => { + console.error(`SW Controller: ${err}`) +}) -- cgit v1.2.3