diff --git a/public/src/app.js b/public/src/app.js index d249fe3cd7..09079f674c 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -788,7 +788,7 @@ app.cacheBuster = null; function registerServiceWorker() { if ('serviceWorker' in navigator) { - navigator.serviceWorker.register(config.relative_path + '/assets/src/service-worker.js', { scope: config.relative_path + '/' }) + navigator.serviceWorker.register(config.relative_path + '/service-worker.js', { scope: config.relative_path + '/' }) .then(function () { console.info('ServiceWorker registration succeeded.'); }).catch(function (err) { diff --git a/src/routes/meta.js b/src/routes/meta.js index 59c5e2e596..ee4ec037cb 100644 --- a/src/routes/meta.js +++ b/src/routes/meta.js @@ -12,7 +12,7 @@ module.exports = function (app, middleware, controllers) { app.get('/manifest.webmanifest', controllers.manifest); app.get('/css/previews/:theme', controllers.admin.themes.get); app.get('/osd.xml', controllers.osd.handle); - app.get('/assets/src/service-worker.js', function (req, res) { + app.get('/service-worker.js', function (req, res) { res.status(200).type('application/javascript').set('Service-Worker-Allowed', nconf.get('relative_path') + '/').sendFile(path.join(__dirname, '../../public/src/service-worker.js')); }); };