added error message in case web worker cannot be started on web-app

master
Niko PLP 4 months ago
parent fa7cd603ee
commit b16e649d53
  1. 3
      ng-app/index-web.html
  2. 1
      ng-app/src/lib/Login.svelte
  3. 3
      ng-app/src/locales/en.json
  4. 11
      ng-app/src/routes/WalletCreate.svelte
  5. 1
      ng-app/src/workertest.js

@ -118,12 +118,15 @@
const supported = (() => {
if (RegExp().hasIndices === undefined) return false;
try {
if (Worker === undefined) return false;
new Worker(URL.createObjectURL(new Blob(['console.log("webworker ok");'], {type: 'application/javascript'})));
if (typeof WebAssembly === "object"
&& typeof WebAssembly.instantiate === "function") {
const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
if (module instanceof WebAssembly.Module)
return new WebAssembly.Instance(module) instanceof WebAssembly.Instance;
}
} catch (e) {
}
return false;

@ -258,6 +258,7 @@
}
} catch (e) {
console.error(e);
if (e.message.includes("constructor") || (typeof e === "string" && e.includes("constructor") )) e = "BrowserTooOld";
error = e;
step = "end";
dispatch("error", { error: e });

@ -603,7 +603,8 @@
"WsError": "WebSocket error",
"cannot_load_this_file": "Cannot load this file",
"graph_not_found": "Graph not found",
"no_wasm_on_old_safari": "Your Safari browser is too old (version before 14.1). As a result we cannot load Automerge, needed for this document. Please upgrade your macOS or iOS system"
"no_wasm_on_old_safari": "Your Safari browser is too old (version before 14.1). As a result we cannot load Automerge, needed for this document. Please upgrade your macOS or iOS system",
"BrowserTooOld": "Your browser is too old. Please upgrade it, use another browser, or install our native app"
},
"connectivity": {
"stopped": "Stopped",

@ -173,6 +173,17 @@
async function bootstrap() {
//console.log(await ng.client_info());
if (!tauri_platform || tauri_platform == "android") {
if (!tauri_platform) {
try {
let worker_import = await import("../workertest.js?worker&inline");
const myWorker = new worker_import.default();
} catch (e) {
registration_error = "BrowserTooOld";
return;
}
}
if (param.get("skipintro") || param.get("rs")) {
intro = false;
}

@ -0,0 +1 @@
console.log("workertest ok");
Loading…
Cancel
Save