background-state
Installation
SKILL.md
Background State
Add background state persistence to an Even Hub plugin by analyzing its code and inserting setBackgroundState + onBackgroundRestore calls from @evenrealities/even_hub_sdk.
Background
The Even Hub host app uses a Headless WebView migration strategy when the phone goes to the background:
inactive— host snapshots current JS state viawindow.__getStateSnapshot()paused— host creates a newHeadlessInAppWebView, loads the same plugin URL, and callswindow.__restoreState(snapshot)to replay the saved state- Background — the headless WebView runs invisibly, continuing to push frames to the glasses
resumed— snapshot is injected into the foreground WebView before it wakes up, then the headless WebView is destroyed
If a plugin does not register any state exporters, __getStateSnapshot() returns '{}' and the headless WebView starts from scratch — causing the plugin to reset to its initial state every time the phone comes back from the background.