1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-05 18:32:30 +01:00

Properly test for WebAssembly presence before use

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/900
This commit is contained in:
Raymond Hill 2020-02-21 15:21:25 -05:00
parent d2b65d0cef
commit 5da3aaaabf
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -679,6 +679,7 @@ const roundToPageSize = v => (v + PAGE_SIZE-1) & ~(PAGE_SIZE-1);
}
async enableWASM() {
if ( typeof WebAssembly !== 'object' ) { return false; }
if ( this.wasmMemory instanceof WebAssembly.Memory ) { return true; }
const module = await getWasmModule();
if ( module instanceof WebAssembly.Module === false ) {