Skip to content

Commit

Permalink
fix(web-backend.js): remove check for Safari browser when allocating …
Browse files Browse the repository at this point in the history
…memory for iOS devices, as it's not necessary
  • Loading branch information
MartinMinkov committed May 30, 2023
1 parent ea06920 commit efebcea
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions js/web/web-backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ let worker;

async function initSnarkyJS() {
const memory = allocateWasmMemoryForUserAgent(window.navigator.userAgent);

await init(undefined, memory);

let module = init.__wbindgen_wasm_module;
let numWorkers = await getEfficientNumWorkers();

Expand Down Expand Up @@ -167,8 +167,7 @@ async function workerCall(worker, type, message) {

function allocateWasmMemoryForUserAgent(userAgent) {
const isIOSDevice = /iPad|iPhone|iPod/.test(userAgent);
const isSafari = /Safari/.test(userAgent);
if (isIOSDevice && isSafari) {
if (isIOSDevice) {
return new WebAssembly.Memory({
initial: 19,
maximum: 16384, // 1 GiB
Expand Down

0 comments on commit efebcea

Please sign in to comment.