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:
Andre Natal 2022-06-13 15:50:03 -07:00 коммит произвёл GitHub
Родитель 3627b8cf89
Коммит 4be46609f4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -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": {