capacitor-lockdown-mode
v0.0.1
Published
Detect iOS Lockdown Mode (which disables WebAssembly) in Capacitor apps
Downloads
31
Maintainers
Readme
capacitor-lockdown-mode
Detect iOS Lockdown Mode in Capacitor apps. iOS Lockdown Mode disables JIT and WebAssembly in WKWebView, which breaks apps that rely on WASM. Use this plugin to detect the condition and warn the user.
iOS only. On web and Android
isLockdownModeEnabled()always resolves to all-false.
Install
npm install capacitor-lockdown-mode
npx cap syncUsage
import { LockdownMode } from 'capacitor-lockdown-mode';
const { enabled } = await LockdownMode.isLockdownModeEnabled();
if (enabled) {
// Show a warning: the app cannot run while Lockdown Mode is active.
}API
isLockdownModeEnabled()
isLockdownModeEnabled() => anyDetect whether iOS Lockdown Mode is active. On web/Android always resolves to all-false (WebAssembly is available, Lockdown Mode is iOS-only).
Returns: any
Interfaces
LockdownModeResult
| Prop | Type | Description |
| ------------------------ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| enabled | boolean | Best-guess: whether the device is in Lockdown Mode (WebAssembly blocked). True when either webpagePreferences or globalDefault is true. |
| webpagePreferences | boolean | WKWebpagePreferences.isLockdownModeEnabled of the bridge web view (iOS 16+, documented API). False on older iOS or non-iOS platforms. |
| globalDefault | boolean | LDMGlobalEnabled from NSGlobalDomain (undocumented fallback signal). |
