Bug 692955 (camera)

camera support for desktop <input accept=image/*> tag.

NEW
Assigned to

Status

()

Firefox
General
6 years ago
2 years ago

People

(Reporter: fabrice, Assigned: fabrice)

Tracking

(Depends on: 2 bugs, Blocks: 3 bugs, {dev-doc-needed})

unspecified
dev-doc-needed
Points:
---
Dependency tree / graph
Bug Flags:
sec-review ?

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(5 attachments, 10 obsolete attachments)

101.44 KB, image/png
Details
103.94 KB, image/png
Details
637 bytes, patch
Details | Diff | Splinter Review
23.78 KB, patch
Details | Diff | Splinter Review
39.06 KB, patch
Details | Diff | Splinter Review
(Assignee)

Description

6 years ago
This bug is about provide support for still image capture from a camera using the <input accept=image/*> tag.

We use the gips library from the webrtc project
(Assignee)

Comment 1

6 years ago
Created attachment 565664 [details] [diff] [review]
part 1: backend

We create an async input stream that receives frames from gips.
(Assignee)

Comment 2

6 years ago
Created attachment 565666 [details] [diff] [review]
part 2: front-end

Showing the capture picker in a tab-modal dialog.
Assignee: nobody → fabrice
(Assignee)

Comment 3

6 years ago
Created attachment 565669 [details]
screenshot: capture picker
(Assignee)

Comment 4

6 years ago
Created attachment 565670 [details]
screenshot: capture done!
(Assignee)

Comment 5

6 years ago
These patches apply on top of the Alder project repository:
http://hg.mozilla.org/projects/alder
Is there a project/feature page for this? Also, you'll want to engage with UX to get a design for the front-end UI this adds.
(Assignee)

Comment 7

6 years ago
The feature page is here: https://wiki.mozilla.org/Platform/Features/Camera_API
Duplicate of this bug: 451674

Comment 9

6 years ago
From dup bug:
Taking photos is extremely privacy sensitive and can, when used without the user noticing, represent a surveillance device inside my house. I personally don't feel comfortable seeing this feature *at all* in Firefox.

But, assuming this is accepted: Given the tricks we've seen with <input type="file"> (ask Jesse Ruderman), please be sure to have explicit consent from the user, in form of a dialog box that cannot possibly be accidentally clicked nor the user tricked into clicking. Inline/inpage approval is not OK.

<sarcasm>We could even do a "authorization=police" parameter, which skips the user confirmation.</sarcasm>
Ben - see https://wiki.mozilla.org/Security/Discussions/WebRTC for the corollary to this bug - access to the camera/microphones for video and audio for WebRTC (and also for added security risk, screen-sharing).  Google has implemented much of this as Google Talk and Google+ Hangouts, and now Hangouts With Extras (which allows screen sharing).

Yes, this is *highly* security/privacy sensitive, and as part of this effort the IETF is looking at the security implications of the protocols and APIs (see ekr's draft from the above wiki page).

Comment 11

6 years ago
A nice way to do this is to have a request made to the user asking if you allow the loaded site to take a picture of you almost like the firefox's popup blocker.
Differences:
When you allow to be taken pictures, you allow the main page, not the frames.
Only the main page is allowed to take pictures. Any frames in it are always denied.
The page may request to take a picture whenever it wants but the picture is only taken when the user presses the <Enter> or the button to take the picture. That button is in a modal box made by the browser or the OS itself (like the file picker). The page has no control over that modal window.
Extra: The modal window should be useful for the user.
Allowing is by page load. Reloading a page means that the approval of allowing to take the picture is lost.

Updated

6 years ago
Keywords: sec-review-needed

Updated

6 years ago
Keywords: dev-doc-needed

Comment 12

6 years ago
> A nice way to do this is to have a request made to the user asking if you
> allow the loaded site to take a picture of you almost like the firefox's popup blocker.
> The page has no control over that modal window.

+1

> when the user presses the <Enter>

That's subject to attacks (e.g. the "press enter game")
(Assignee)

Comment 13

6 years ago
Created attachment 570795 [details] [diff] [review]
part 1 : gips backend

updated gips backend
Attachment #565664 - Attachment is obsolete: true
(Assignee)

Comment 14

6 years ago
Created attachment 570797 [details] [diff] [review]
part 2: capture picker UI

Fixes an osx only bug
Attachment #565666 - Attachment is obsolete: true
(Assignee)

Comment 15

6 years ago
Created attachment 570798 [details] [diff] [review]
part 3: xcode 4.2 support

Updated

6 years ago
Alias: camera
Blocks: 528886, 673923

Updated

6 years ago
Depends on: 700232
removing sec-review-needed and marking the feature page instead
Keywords: sec-review-needed
(Assignee)

Comment 17

6 years ago
Mockups from Jennifer:
http://people.mozilla.com/~jboriss/specs/first_spec.png

Comment 18

6 years ago
Looks great! And good from privacy perspective.

I also like that I can take a file from disk instead.

Comment 19

6 years ago
(In reply to Fabrice Desré [:fabrice] from comment #17)
> Mockups from Jennifer:
> http://people.mozilla.com/~jboriss/specs/first_spec.png

These look really nice and very promising.

Suggestion: it is not uncommon for websites to want pictures with a specific aspect ratio. For instance, profile pictures may have to be square, or portrait 4x3. This is often supported either with direct truncation (where the server side just cuts the picture without asking the user) or with some in-page script that allows the user to select which area to use, within constraints. A lot of those script solutions are a bit heavy handed, and aren't always very accessible. Since I note that you are already considering a way of selecting an area in the picture, it could be useful to allow for a constrained aspect ratio mode. This could be specified by the page author using one of the markup hints that we're looking into.

Other non-UI hints could be useful, such as indicating which size boundaries the author wants so that the UA could provide an already-resized image. Such small additions could really help authors.
Depends on: 643692

Comment 20

6 years ago
Please, How I can to take a snapshot from a webcam in a desktop computer with Firefox?, What is the code supported?

Comment 21

6 years ago
(In reply to Junior from comment #20)
> Please, How I can to take a snapshot from a webcam in a desktop computer
> with Firefox?, What is the code supported?

when this lands in desktop Firefox, you will be able to do this via <input accept=image/*> on a webpage.
Created attachment 585530 [details] [diff] [review]
gips backend updated for bitrot
Created attachment 585531 [details] [diff] [review]
capture UI updated for bitrot
Added URL for fabrice's test (perhaps you should put the code here)
Created attachment 586224 [details] [diff] [review]
gips backend updated for EXPORTS change

Updated

5 years ago
Attachment #585530 - Attachment is obsolete: true

Updated

5 years ago
Depends on: 718031
Created attachment 590312 [details] [diff] [review]
capture picker UI - updated for gkmedia m-c merge

Updated

5 years ago
Attachment #585531 - Attachment is obsolete: true
I pushed a couple of changes to alder:
http://hg.mozilla.org/projects/alder/rev/84616cd44046
http://hg.mozilla.org/projects/alder/rev/b25db6a3947e

With those changes, I was able to build with these patches applied and get working video capture on Windows.
Created attachment 599277 [details] [diff] [review]
Part 1: GIPS backend, updated for m-c merge
Attachment #570795 - Attachment is obsolete: true
Attachment #586224 - Attachment is obsolete: true
Created attachment 599278 [details] [diff] [review]
Part 2: capture picker UI, updated for m-c merge
Attachment #570797 - Attachment is obsolete: true
Attachment #590312 - Attachment is obsolete: true
(Assignee)

Updated

5 years ago
Depends on: 730289
No longer depends on: 730289
Keywords: sec-review-needed
need to schedule a full team review
Whiteboard: [secr:cutisk]

Updated

5 years ago
Blocks: 741393
Please follow the instructions on this page to schedule a review.
Depends on: 749625
Whiteboard: [secr:cutisk] → [sec-assigned:cutisk:749625]
Created attachment 619047 [details] [diff] [review]
Part 1: GIPS backend, updated for webrtc merge - non-functional

Updated

5 years ago
Attachment #599277 - Attachment is obsolete: true
Created attachment 619048 [details] [diff] [review]
Part 2: capture picker UI, updated for webrtc merge - non-functional

Updated

5 years ago
Attachment #599278 - Attachment is obsolete: true
These updated patches (probably the second one) are non-functional - no "Capture" button appears.  They compile clean, though! :-)  They are for running on top of the about-to-be-pushed update to alder from webrtc.org
Summary: camera support for desktop → camera support for desktop <input accept=image/*> tag.
Flags: sec-review?(curtisk)
Whiteboard: [sec-assigned:cutisk:749625]
Flags: sec-review?(curtisk) → sec-review?
You need to log in before you can comment on or make changes to this bug.