diff --git a/src/vector/app.js b/src/vector/app.js index 3c0c0922..f4cd3082 100644 --- a/src/vector/app.js +++ b/src/vector/app.js @@ -186,9 +186,10 @@ export async function loadApp() { MatrixClientPeg.setIndexedDbWorkerScript(vectorIndexeddbWorkerScript); // load dendrite, if available - if (window.vector_dendrite_worker_script && 'serviceWorker' in navigator) { + const vectorDendriteWorkerScript = document.body.dataset.vectorDendriteWorkerScript; + if (vectorDendriteWorkerScript && 'serviceWorker' in navigator) { window.addEventListener('load', ()=>{ - navigator.serviceWorker.register(window.vector_dendrite_worker_script, { scope: "/" }).then(function(registration) { + navigator.serviceWorker.register(vectorDendriteWorkerScript, { scope: "/" }).then(function(registration) { // Registration was successful console.log('ServiceWorker sw.js registration successful with scope: ', registration.scope); /* const currWorker = registration.active; diff --git a/src/vector/dendrite-sw.js b/src/vector/dendrite-sw.js index 6d7e5624..4092c8a3 100644 --- a/src/vector/dendrite-sw.js +++ b/src/vector/dendrite-sw.js @@ -1,4 +1,3 @@ -// -*- coding: utf-8 -*- // Copyright 2020 The Matrix.org Foundation C.I.C. // Copyright 2020 New Vector Ltd // diff --git a/src/vector/index.html b/src/vector/index.html index e3e6c1fd..ba8e14d4 100644 --- a/src/vector/index.html +++ b/src/vector/index.html @@ -49,12 +49,10 @@ <% } } %> -
+ -