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"; 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) // make sure the server is up (active service worker)
await navigator.serviceWorker.ready; 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; let response = null;
try { try {

Binary file not shown.

View File

@ -32,7 +32,7 @@ module.exports = (env, argv) => {
entry: { entry: {
"bundle": "./src/vector/index.js", "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", "dendrite_sw": "./src/vector/dendrite-sw.js",
"mobileguide": "./src/vector/mobile_guide/index.js", "mobileguide": "./src/vector/mobile_guide/index.js",
"sqlitejs": "./src/vector/sqlitejs.js", "sqlitejs": "./src/vector/sqlitejs.js",