Skip to content

Commit 2064dd4

Browse files
committed
feat(diagnostics): check if WebAssembly is supported
1 parent 8c861ee commit 2064dd4

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/app/Marine2/components/views/DiagnosticsView.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,19 @@ const getDeviceDiagnostics = (windowSize: { width?: number; height?: number }) =
6969
property: translate("diagnostics.device.viewportHeight"),
7070
value: (windowSize.height ?? window.innerHeight) + "px",
7171
},
72+
{
73+
property: translate("diagnostics.device.isWebAssemblySupported"),
74+
value: `${checkIfWebAssemblyIsSupported()}`,
75+
},
7276
]
7377
}
7478

79+
const checkIfWebAssemblyIsSupported = () => {
80+
// Check for WebAssembly presence
81+
if (typeof WebAssembly === "object" && typeof WebAssembly.instantiate === "function") {
82+
return true
83+
}
84+
return false
85+
}
86+
7587
export default observer(DiagnosticsView)

src/app/locales/languages/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@
115115
"device": "Device",
116116
"userAgent": "User agent",
117117
"viewportHeight": "Viewport height",
118-
"viewportWidth": "Viewport width"
118+
"viewportWidth": "Viewport width",
119+
"isWebAssemblySupported": "WebAssembly supported"
119120
},
120121
"diagnostics": "Diagnostics"
121122
},

0 commit comments

Comments
 (0)