Camera Capture in the Browser Without Fighting Permissions

Published 2026-01-14 by Faraz Rahimi

The permission prompt is part of the product. Ask at the moment of the shutter, explain why, and survive the user who hit block.

Camera Capture in the Browser Without Fighting Permissions

Tags: React, Mobile, Camera, UX, unlisted

I do not ask for the camera on landing. I ask when they tap capture, with a line about photographing the item, not them.

If they blocked it, I show how to undo that on iOS and Android in two screenshots, because they will not search settings while holding a box.

Prefer the file input fallback

A capture file input still works when getUserMedia is a maze. It is not pretty. It unblocks the day.

HTTPS and a real origin

Camera APIs fail on odd previews and mixed content. If the staging link is wrong, the bug is not React. I keep a known-good URL taped near the pack table.

Original post: https://farazrahimi.com/posts/camera-capture-in-the-browser-without-fighting-permissions