Camera/Gallery Selection Test

Test these inputs on Android Chrome to see which triggers the "Camera vs Gallery" chooser.

1. Standard Image Accept

accept="image/*"

The default. Often forces the new Photo Picker (no camera tile).

2. Force Capture

accept="image/*" capture="environment"

Usually skips gallery entirely and opens Camera directly.

3. Multiple Images

accept="image/*" multiple

Sometimes triggers a different intent (legacy picker) to allow batch selection.

4. Specific Extensions

accept=".jpg, .jpeg, .png"

Avoids the generic "image/*" wildcard, possibly bypassing the Photo Picker.

5. Mixed Type Workaround

accept="image/*, .pdf"

Adding a non-image type forces Android to use the generic System File Picker (which usually offers Camera).

6. Fake MIME Hack

accept="image/*, android/hack"

A newer hack. Forces the browser to treat this as a generic file request because it doesn't recognize the second MIME type.

7. No Accept (Control)

(no accept attribute)

Should always offer Camera, Camcorder, and Files, but offers no filtering.

more cases

... since on of the above worked within the Home Assistant App (/ its WebView).

1. Force Camera (User)

accept="image/*" capture="user"

Tests if the WebView can handle a direct camera capture intent.

2. Force Camera (Environment)

accept="image/*" capture="environment"

Same as above, but for the rear camera.

3. Force Video Capture

accept="video/*" capture="user"

Tests if it's an image-only issue. Does it handle video?

4. No Accept Attribute

(no accept attribute)

What is the default file picker? Does *it* have a camera option?

more...

1. Force Camera (User)

accept="image/*" capture="user"

Standard HTML5 "force camera" request.

2. Force Camera (Environment)

accept="image/*" capture="environment"

Standard HTML5 "force rear camera" request.

3. No Accept Attribute

(no accept attribute)

What is the default file picker? Does *it* have a camera option?

4. Non-standard `accept` Hack

accept="image/*;capture=camera"

A non-standard syntax found in a Gist. Unlikely to work, but worth a test.

5. Original "Fake MIME" Hack

accept="image/*, android/hack"

Our control. We expect this to fail here, proving the WebView is different from Chrome.