4 ms·
This spec is one of the most interesting features to come to the web. I can think of at least three ways I can use something like this to deliver interesting ex
by sillysaurus3 11y ago
This spec is one of the most interesting features to come to the web. I can think of at least three ways I can use something like this to deliver interesting experiences to users, which would not otherwise be possible.
Yes, it increases the attack surface. This is a real danger, and should not be taken lightly. But no one is taking it lightly.
Another danger, which I haven't seen mentioned yet, is that it increases your fingerprint. If a website can list the Web USB devices currently connected, that's a way to deanonymize you.
But if you set aside those negative qualities, WebUSB, I think, is one of the more important features on the horizon.
For example, I could build and ship a light sensor. The idea is that you'd connect it to your laptop, and websites would be able to react to your environment's lighting + your current screen brightness. Think dynamic color schemes that always look good no matter what kind of monitor you're using, or whether it's night or day. This is only possible with hardware; no amount of software will make this feature available. And I can't think of any convenient way to do it other than WebUSB.
- weddpros 11y agothe industry was never able to deliver half correct default ICC profiles, and you'd like to alter these badly calibrated screens dynamically?
- sillysaurus3 11y agoIt's the only way to do it. The light sensor delivers a realtime feed of what your eye currently sees. A website can react appropriately. It's actually more powerful than monitor calibration. Calibration doesn't account for the viewing condition (the brightness of your environment) whereas this hardware can.
- weddpros 11y agoand only works in a browser... which makes it useless for all the people who care about color. It should really be the responsibility of the OS only... and browsers should all be ICC aware to begin with (a few years ago, only Safari was)
- sillysaurus3 11y agoIt's a device, so it can feed the information to all the programs on your computer. WebUSB is a way to make it useful from day one, but it's not the sole target.
- weddpros 11y agoWebUSB is a way to make it useful from day one => if WebUSB was marketed with this business goal, then why not (except nobody would buy it)? but the implications are so much wider, in terms of security and usability... Why not WebSATA? WebPCI? There are certainly a few key actors who would benefit from such a standard (benefits could be time to market), I'm just not sure it's enough benefits for the end user to justify a new standard!
- crazyhatfish 11y agoI don't think direct access to USB devices like your suggesting is a good step forward if for nothing other than practicalities. Think about how many individual USB light sensors your websites would have to support to enable this small feature and the amount of low-level code in such a high-level language. Abstractly thats a great idea but could as easily be added with an addon or browser extension.
- sillysaurus3 11y agoActually, it's not a small feature. It's a feature that seems small until you experience it firsthand, similar to the Apple II. Beyond that, I don't understand any of the other objections. Low level code in a high level language is one definition of power.
- crazyhatfish 11y agoHave you experienced it? If so, where can I? I'm not saying its a bad idea, just that this direct path in implementation is. There are many other (better) ways of implementing it, like the Mozilla light sensor API. If that doesn't satisfy you, you should create a new spec for light sensors combined with a practical implementation and then push W3C to use your spec over Mozilla's.
- castis 11y agoYou might find this interesting, Mozilla is working on an ambient light sensor API. https://developer.mozilla.org/en-US/docs/Web/API/DeviceLightEvent https://developer.mozilla.org/en-US/docs/Web/API/DeviceLight...
- sillysaurus3 11y agohttps://w3c.github.io/ambient-light/#dom-ambientlightsensorreading-illuminance https://w3c.github.io/ambient-light/#dom-ambientlightsensorr... Unfortunately, it looks like their definition of brightness is a floating point number, and that's the only thing their API exposes. Hopefully future versions of the standard will be updated to better match the real world. What we perceive as brightness is (a) the number of photons of each wavelength that (b) intersect a given point in space and (c) are exiting in a given direction. Obviously, all of this information can't be encoded in digital form. There's simply too much data to encode, let alone measure accurately. But reducing the data to a simple 1D number renders the data almost useless. No website will be able to achieve good results if the dynamic color scheme is based on a single number. That's also why the WebUSB spec is exciting. I don't have to wait for this spec to be drafted, or for browsers to support it, or to live with any shortcomings it ships with. I'm free to create.
- robbles 11y agoWhat kind of physical sensor are you proposing that would give you data like that? I think most ambient light sensors in laptops are just LDRs, which are only capable of giving you a 1D number.
- sillysaurus3 11y agoI propose that this is a capital-H Hard Problem, and that new technology is needed to address it. I further propose that this technology exists, but is not yet mainstream. The fact that monitors can be calibrated to great accuracy is proof that the tech exists. There is an opportunity here, but to understand this space, you have to dive into it. There are some excellent books on the subject of colorimetery, but a quick bootstrapped understanding might look like: 1. Your eyes are designed to fool you. 2. How your eyes fool you is determined entirely by the photons that enter it. 3. Each of these photons has a wavelength. The more of them at a given wavelength, the more your perception shifts. 4. What you perceive as color is a combination of wavelengths. But -- critically -- these combinations affect each other. It is not true to say that the more photons that arrive at a given wavelength, the more intensely you perceive that wavelength. It causes a shift in your perception, but this shift is not necessarily a simple increase in brightness. These are first principles, and it's a very brief sketch of the problem. But everything else follows from this. What ambient light sensors currently do, how APIs are designed, etc is all secondary. The problem is both as simple and as difficult as outlined above. Now, you can say that this isn't worth tackling, or that the current systems are good enough, and so on. But you'd be missing out on quite an experience. Seeing the type of results you can get from a perfectly calibrated environment is really mindblowing. And the interesting part is, it's impossible for me to describe these results in text, or by showing you a photo, or a video, for the same reason you can't describe an Oculus experience. You have to be there. Personally, I find colorimetry one of the most intellectually fun and gratifying areas of science.
- Matthias247 11y ago> And I can't think of any convenient way to do it other than WebUSB. Simple. Deliver a native application with your device sensor that the user has to install (maybe it could even be automatically installed through PnP). This application would provide a webserver on localhost which exposes the lighting information to interested websites. And in contrast to the WebUSB thing it would mediate the access to the USB device (lots of browser windows and processes can get the information instead of only a single one) and it would guarantee that only the relevant information is forwarded and not arbitrary data on an USB channel.
- BinaryIdiot 11y agoInstalling native applications are not always easy and straight forward especially in a commercial environment or an environment with multiple operating systems. For an enterprise they rarely want to push out new applications to every user because it's a pain to support. But tell them to go to a new web app? Easy. I'm a big fan of native apps over web app. But web apps have a huge practically that's hard to ignore.
- Matthias247 11y agoI'm very aware of that, as I have worked for a big corporation with such policies for normal users. However I believe that for them browsers which directly access real hardware will seem like an even bigger nightmare than users installing applications. And you still have the question on how the web app comes to the user: Through a dedicated intranet site? Makes sense if more than one user requires it, but the effort seems similar as packaging a native application and rolling it out automatically through the ITs deployment system. If only very few users (maybe only a single one) requires that hardware both approaches have a high overhead and supporting the device will be most likely rejected. Getting this web app directly from a third party site will be mostly out of question for the companies you are talking about. Besides the security implications then we also talk about reliability problems ("I can't use my USB device because internet is down...")
- BinaryIdiot 11y ago