diff --git a/config.js.example b/config.js.example index e3fb6ad..f86daa6 100644 --- a/config.js.example +++ b/config.js.example @@ -29,10 +29,11 @@ self.LibResilientConfig.plugins = [{ 'https://gateway.pinata.cloud/ipns//', // Germany 'https://.ipns.bluelight.link/' // Singapore - ]},{ - name: 'gun-ipfs', - gunPubkey: '' - }] + ] + },{ + name: 'gun-ipfs', + gunPubkey: '' + }] }] // we need to explicitly list components we want to see debug messages from diff --git a/libresilient.js b/libresilient.js index cc51cad..4784853 100644 --- a/libresilient.js +++ b/libresilient.js @@ -498,7 +498,15 @@ if ('serviceWorker' in navigator) { var scriptFolder = scriptPath.substr(0, scriptPath.lastIndexOf( '/' )+1 ) var serviceWorkerPath = scriptFolder + 'service-worker.js' self.log('browser-side', 'Service Worker script at: ' + serviceWorkerPath) + // TODO: is there a way to provide config params for the Service Worker here? + // TODO: it would be good if the config.js script could reside outside of the libresilient directory + // TODO: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register navigator.serviceWorker.register(serviceWorkerPath, { + // TODO: what is the scope relative to? is it the HTML file that included it, or this script? + // TODO: "It is relative to the base URL of the application." ¯\_(ツ)_/¯ + // TODO: "There is frequent confusion surrounding the meaning and use of scope. + // TODO: Since a service worker can't have a scope broader than its own location, + // TODO: only use the scope option when you need a scope that is narrower than the default." scope: './' }).then(function(reg) { // Success.