# Beyond ctx

`ctx` is what Fave1 adds. The rest of the browser is there too — with a few rules, because on a site you run on someone else’s page.

card mode · app mode · reviewed

## The browser, as usual

| API | What to know | When |
| --- | --- | --- |
| `Web Audio` | Start it from a tap. On iPhone set `navigator.audioSession.type = 'playback'` while sound is on — or the silent switch mutes you — and back to `'auto'` when it’s off or your app closes | a tap |
| `navigator.clipboard` | A Copy button needs no permission — call `writeText()` inside the tap. `write()` with a `ClipboardItem` copies a picture. **Reading is not yours to do here** — paste with [ctx.clipboard.read()](https://developers.fave1.com/docs/ctx-clipboard.md), which asks the person every time; review sends back apps that read the clipboard any other way | a tap |
| `navigator.share` | The phone’s share sheet, files included where `canShare({ files })` says so | a tap |
| `downloads` | An `<a download>` with an object URL. Revoke the URL after | a tap |
| `getDisplayMedia` | Screen capture and `MediaRecorder`. Call it inside the tap, and [hide()](https://developers.fave1.com/docs/ctx-ui.md#hide) Fave1 first. On a site the browser asks in that site’s name — say so in your panel. To keep the cursor out of it, set `cursor: none` on the page while you capture, or use pointer lock (below). Not inside My Fave1 — [the frame](https://developers.fave1.com/docs/app-mode.md#my-fave1) doesn’t allow it | a tap |
| `requestPointerLock` | Fine for a game or a capture. Lock inside the tap, and give the mouse back the moment that’s over — `document.exitPointerLock()` in a `finally` and in `onDestroy`. If they press Esc, stay unlocked until they tap again. Review sends back apps that lock at launch or never let go. Not inside My Fave1 | a tap |
| `getUserMedia` | Not yours to call — on a site or in app mode. Use [ctx.camera](https://developers.fave1.com/docs/ctx-camera.md) and [ctx.mic](https://developers.fave1.com/docs/ctx-mic.md), which ask in Fave1’s name and turn off when your app closes. Calling it yourself fails review | — |
| `motion` | `DeviceOrientationEvent.requestPermission()` on iPhone, inside the tap. Have a fallback — many devices and frames send nothing | a tap |
| `window.open` | A new tab or a small window — a share composer, your app in app mode | a tap |
| `localStorage · IndexedDB` | On a site this is *the site’s* storage, and its scripts can read it: prefix keys with your app ID and keep only what’s harmless — a local copy of [prefs](https://developers.fave1.com/docs/ctx-storage.md#prefs). In app mode it’s your own | any |

“A tap” means inside the handler of the click or key that asked for it — browsers refuse these a moment later, even after one `await`.

## The network

- **What the page already loads** (yes) — Its images, stylesheets and fonts, with `fetch` — the page’s CSP and each server’s CORS still apply. For a picture that won’t share, [fetchImage()](https://developers.fave1.com/docs/ctx-page.md#images).
- **What they send on purpose** (yes) — They tapped a service: open its own share or compose page with the link and words they chose. Nothing goes until they tap.
- **One vendor SDK** (app mode only) — A messenger’s share kit, say. In app mode only, a pinned version with an integrity hash, loaded when they’re about to use it, and named in Notes for reviewer.
- **Anything else out** (no) — No analytics, no trackers, no page content or activity sent to your server or anyone’s. Keep what lasts in `ctx.storage`, `ctx.files`, `ctx.shared` or `ctx.pub`.
- **A socket of your own** (no) — No WebSocket, no WebRTC, no long-poll to a server you run. People who need to see each other type meet in a [ctx.live](https://developers.fave1.com/docs/ctx-live.md) room, and two who need it fast open a [direct line](https://developers.fave1.com/docs/ctx-live-direct.md) there — Fave1 holds both connections, and nothing about the page leaves them.
- **Code from the network** (no) — No `eval`, no `new Function`, no script tags on someone’s site. [ctx.config](https://developers.fave1.com/docs/ctx-config.md) is data, never code.

Review checks these. They’re the same rules Fave1’s own apps follow.
