Data protection API
Native capture protection and local web data deletion.
Native enablement is internalPlugins.dataProtection. Radical supplies the native implementation without an extra capability package.
setDataProtection(enabled) returns an Effect of DataProtectionStatus requiring Bridge. DataProtectionStatusSchema validates four booleans: enabled, screenshots, recording, and appSwitcher.
| Runtime | Protection |
|---|---|
| Android | Secure-window protection blocks screenshots and recording and protects the app switcher. |
| iOS | Obscures active capture and the app switcher. Cannot block screenshots. |
| Browser | Returns all fields false. Does not protect the screen. |
Protection persists until explicitly disabled, including after hook unmount. Status reports supported behavior; it does not prove that no capture occurred.
clearWebData
clearWebData is an Effect of void requiring Bridge | BrowserDataProtection.
| Deletion phase | Scope |
|---|---|
| Browser first | Pause snapshot writes; unregister workers; delete Cache Storage and enumerated IndexedDB databases; clear local and session storage; expire accessible cookies |
| Native next | Native WebView data, including data inaccessible to browser JavaScript |
| Browser limits | HttpOnly cookies inaccessible; database enumeration requires indexedDB.databases |
Clearing requires closed IndexedDB connections and can fail after partial deletion. It neither reloads the document nor stops application writes.
dataProtectionLive(effect) provides BrowserDataProtectionLive. BrowserDataProtection exposes the injectable clear operation.
| Error | Meaning |
|---|---|
BridgeError | Includes BridgeDecodeError for invalid enabled values |
WebDataClearFailed | Clearing failed; carries cause |
useDataProtection() exposes setEnabled(enabled) and clearWebData() with action state. Its value is the protection status or true after successful clearing.
Source: data protection implementation.