packages/js128/823094.diff
2024-10-25 10:59:22 +02:00

38 lines
1.5 KiB
Diff

# HG changeset patch
# User Cameron Kaiser <spectre@floodgap.com>
# Date 1723334623 25200
# Sat Aug 10 17:03:43 2024 -0700
# Node ID 2218b964b69620510c05731522c4582e44b04766
# Parent 1cc1170fa6261938764d45e94de640edf8c6ca81
provisional fix for bug 1912623
diff -r 1cc1170fa626 -r 2218b964b696 toolkit/components/translations/actors/TranslationsParent.sys.mjs
--- a/toolkit/components/translations/actors/TranslationsParent.sys.mjs Sat Aug 10 17:02:36 2024 -0700
+++ b/toolkit/components/translations/actors/TranslationsParent.sys.mjs Sat Aug 10 17:03:43 2024 -0700
@@ -618,16 +618,25 @@
* Detect if Wasm SIMD is supported, and cache the value. It's better to check
* for support before downloading large binary blobs to a user who can't even
* use the feature. This function also respects mocks and simulating unsupported
* engines.
*
* @type {boolean}
*/
static getIsTranslationsEngineSupported() {
+ try {
+ // Ensure WebAssembly is supported and enabled (may not be on tier-3).
+ if (!WebAssembly) {
+ return false;
+ }
+ } catch(e) {
+ return false;
+ }
+
if (lazy.simulateUnsupportedEnginePref) {
// Use the non-lazy console.log so that the user is always informed as to why
// the translations engine is not working.
console.log(
"Translations: The translations engine is disabled through the pref " +
'"browser.translations.simulateUnsupportedEngine".'
);