Restrict minimum version to what's compatible with the wasm engine and report errors compiling (#399)
* Restricit minimum fx version to what's compatible with the wasm nmt engine * Capture and report wasm compilation errors * Remove legacy loading for services object prior to Fx 88
This commit is contained in:
Родитель
3627b8cf89
Коммит
4be46609f4
|
@ -7,12 +7,6 @@
|
|||
|
||||
/* global ExtensionCommon, ExtensionAPI, ChromeUtils, Services, modelRegistry, TranslationNotificationManager */
|
||||
|
||||
// the Services object was not available until Firefox 88 - bugzil.la/1698158
|
||||
if (typeof Services === "undefined") {
|
||||
// eslint-disable-next-line no-invalid-this
|
||||
this.Services = ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
|
||||
}
|
||||
|
||||
/*
|
||||
* custom elements can only be registered, and not unregistered.
|
||||
* To make sure that the extension is able to register the custom element
|
||||
|
|
|
@ -66,6 +66,12 @@ class TranslationHelper {
|
|||
this.wasmModuleStartTimestamp = Date.now();
|
||||
}.bind(this)
|
||||
],
|
||||
onAbort() {
|
||||
sendException(new Error("Error loading engine (onAbort)"));
|
||||
console.log("Error loading wasm module.");
|
||||
postMessage(["reportError", "engine_load"]);
|
||||
postMessage(["updateProgress", "errorLoadingWasm"]);
|
||||
},
|
||||
onRuntimeInitialized: function() {
|
||||
|
||||
/*
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
"applications": {
|
||||
"gecko": {
|
||||
"id": "firefox-translations-addon@mozilla.org",
|
||||
"strict_min_version": "79.0"
|
||||
"strict_min_version": "90.0"
|
||||
}
|
||||
},
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "firefox-translations-addon@mozilla.org",
|
||||
"strict_min_version": "79.0"
|
||||
"strict_min_version": "90.0"
|
||||
}
|
||||
},
|
||||
"options_ui": {
|
||||
|
|
Загрузка…
Ссылка в новой задаче