Bugfixes for firefox

This commit is contained in:
Kegan Dougal 2020-04-02 18:20:34 +01:00
parent 9328519c29
commit 9994c9ea65
3 changed files with 10 additions and 1 deletions

View File

@ -191,8 +191,17 @@ async function autoRegister() {
});
const password = "this should be really really secure";
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
// make sure the server is up (active service worker)
await navigator.serviceWorker.ready;
// on Firefix, the ready promise resolves just prior to activation
// on Chrome, the ready promise resolves just after activation.
// We need to make requests AFTER we have been activated, else the /register request
// will fail.
await sleep(10);
let response = null;
try {

Binary file not shown.

View File

@ -32,7 +32,7 @@ module.exports = (env, argv) => {
entry: {
"bundle": "./src/vector/index.js",
// "indexeddb_worker": "./src/vector/indexeddb-worker.js",
"indexeddb_worker": "./src/vector/indexeddb-worker.js",
"dendrite_sw": "./src/vector/dendrite-sw.js",
"mobileguide": "./src/vector/mobile_guide/index.js",
"sqlitejs": "./src/vector/sqlitejs.js",