5 ms·
Mozilla's WebAPI takes shape, can now read battery state, send SMS, vibrate
- nkassis 15y agoCool 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.
- thedjpetersen 15y agoI wasn't aware that Mozilla planned to build some sort of OS as well. It is nice that they are pushing for a more open version of Android. Its neat to see another large organization like Mozilla bring apps from the desktop to the web.
- sabret00the 15y agoBut they're not pushing for a more open version of Android, they're pushing for a mobile version of ChromeOS.
- drivebyacct2 15y agoIndeed. https://wiki.mozilla.org/B2G https://wiki.mozilla.org/B2G
- starwed 15y ago>whether ARM processors will ever be able to execute JavaScript at native-like speeds is still unknown. Does this have a secret meaning I can't discern, or is it just nonsense?
- mrsebastian 15y agoThanks; fixed. Was more of a 'whether JS will ever reach native-level performance' comment.
- Raphael 15y agoHTML renderers often have choppy animation and transitions.
- starwed 15y agoIt was the bit about ARM processors that made no sense -- the author since edited it out, since that wasn't the point he was trying to make! :)
- peterwwillis 15y ago<rant> This brings up troubling thoughts of how the web (as well as personal choice and a growing economic disparity) is being eroded by the senseless advance of technology. Recently someone's start-up website refused to work on my Android phone because it didn't support WebSockets. I thought, "Wow, what a bunch of dicks. Now I have to get a better phone that can run Firefox Mobile or something." But I can ignore that one website. Imagine every popular website requiring technology that only expensive cutting-edge devices can utilize. At some point you'll have to have a certain amount of disposable income just to browse the web. This should not be the case; everyone on the planet should some day be able to use the internet to the fullest given the most modest means. Even if you stick to non-mobile surfing, is your current computer's operating system modern enough to run the latest and greatest web browsing app? If you wanted to upgrade the OS, would you be able to, considering how old your computer is? The World Wide Web is not meant to be a platform for an operating system on top of an operating system. It's meant to provide formatted data with inline images and hyperlinks. A ubiquitous, universal, cross-platform resource for information. I wonder if people consider accessibility anymore. </rant>
- gkoberger 15y agoWait, what? Why should we be holding back the web to satisfy your definition of what the web should be? It's up to websites to decide what technologies to take advantage of, as it's always been. JavaScript is ubiquitous now, but it wasn't always -- some sites used it, others didn't. The web didn't die, and eventually adoption became widespread. Same goes for other advancements. If I want to browse Wikipedia, I should be able to do so without having a top of the line computer running the latest browser (although Firefox runs on just about anything). However, why should we not allow someone to create, say, a multi-user realtime image editor, merely because it doesn't run on your computer? The irony of your rant is that these APIs are to help combat exactly what you're afraid of. In theory, these APIs will eventually work on an iPhone, WP7 or Android phone. Currently, you need to buy an iPhone if you want to use an iPhone app. These APIs were created in order to make "apps" platform agnostic, via the web.
- peterwwillis 15y ago