diff --git a/fiat-html/disable-wasm-option.js b/fiat-html/disable-wasm-option.js new file mode 100644 index 00000000000..2c907f8a611 --- /dev/null +++ b/fiat-html/disable-wasm-option.js @@ -0,0 +1,21 @@ +document.addEventListener('DOMContentLoaded', async function() { + const wasmCheckbox = document.getElementById('wasm'); + const extraWasmLabel = document.getElementById('extraWasmLabel'); + wasmCheckbox.disabled = true; // Initially disable the checkbox + + try { + if (await wasmFeatureDetect.tailCall()) { + wasmCheckbox.disabled = false; // Re-enable the checkbox if tail calls are supported + } else { + wasmCheckbox.checked = false; + + if (navigator.userAgent.includes('Firefox')) { + extraWasmLabel.innerHTML = '(enable javascript.options.wasm_tail_calls in about:config)'; + } else { + extraWasmLabel.innerHTML = '(wasm tail calls not supported)'; + } + } + } catch (error) { + console.error('Error checking wasm tail call support:', error); + } +}); diff --git a/fiat-html/fiat-crypto.html b/fiat-html/fiat-crypto.html index 69b37b48421..425c68af417 100644 --- a/fiat-html/fiat-crypto.html +++ b/fiat-html/fiat-crypto.html @@ -5,7 +5,7 @@ Fiat Cryptography Web Interface