oc_context_import
Import a browser context envelope into a tab, replacing cookies and storage after verifying SHA-256 integrity. Existing data for the origin is cleared before installing the payload.
Instructions
Strict-replace import of a ContextEnvelope produced by oc_context_export. Verifies the SHA-256 integrity hash first — on mismatch returns { ok: false, integrityError } WITHOUT applying any state. On success, existing cookies for the envelope origin and the active-origin web storage are CLEARED, then the envelope payload is installed. Merge semantics are intentionally not supported. SECURITY: the envelope is plaintext — the host MUST treat it as a secret.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tabId | Yes | REQUIRED Tab ID to apply the envelope to. | |
| envelope | Yes | REQUIRED A `ContextEnvelope` produced by `oc_context_export`. | |
| strictOrigin | No | When true, reject the import if the active tab origin does not match `envelope.origin`. Default: false (caller is responsible for navigating). |