4 ms·
Cool but does Firefox have some sort of whitelist to give certain sites permissions to use these apis? I don't want random sites snapping images of my crotch.
by nkassis 15y ago
Cool but does Firefox have some sort of whitelist to give certain sites permissions to use these apis? I don't want random sites snapping images of my crotch.
- mrsebastian 15y agoGood question. I don't think it does yet -- but you have to assume that it's on the To Do list.
- mbrubeck 15y agoYes, browsers will ask permission before letting any site use these APIs, just as they already do for many other APIs like Appcache, Local Storage, Geolocation, popups, Desktop Notifications, etc. You can see this in action by trying out any of these APIs in a browser that supports them. For example, most browsers now support Geolocation and will display a permission request when you launch this demo (unless you have already whitelisted the domain): https://developer.mozilla.org/en-US/demos/detail/urban-arteries https://developer.mozilla.org/en-US/demos/detail/urban-arter... Camera capture in particular can only be initiated and controlled by the user -- it works just like the regular file upload dialog, but instead of a file picker dialog the browser shows a camera dialog. Just like file upload, camera capture happens only if the user presses the a button on an input[type="file"] element, and just like the regular file picker dialog, the capture picker is under the user's control so you can decide when to snap the picture, and whether to upload the resulting image.
- DrCatbox 15y agoSo what does a user do if he wants to upload a file from the sd-card and not take a picture to upload it!?
- drivebyacct2 15y agoThat's how the Gallery file selector works in Android. You can pick (first of all, an entirely different app like a file manager to pick the upload file, or) a photo from a gallery, or snap a new one and use it.
- mbrubeck 15y agoIn Firefox there are two buttons in the file input widget (when it includes the accept="image/*" attribute): one to "browse" and one to "capture."
- icebraining 15y agoThey already ask before giving the site your location - the same system can probably be reused.