News for hackers. Stuff that matters.
Re:TIL: You can access a user’s camera with just HTML by Waterluvian on Tuesday September 06, 2022 @12:15PM (#32739208)
A lot of totally valid opinions out there about this, but I personally _love_ how the browser is becoming a very well-featured sandbox for shipping applications.

For personal fun and learning, I'm making a complete 2D video game in ideally less than 1MB. It has 60fps graphics, full spatial audio, and gamepad support, all because the browser has a lot of these APIs that didn't exist when I was starting out my career. The only issue I'm having so far with the user experience is the desire to assume complete control of your keyboard the way a traditional PC game would, because browsers really don't want you to own _every_ key.

Re:TIL: You can access a user’s camera with just HTML by osrec on Tuesday September 06, 2022 @01:12PM (#32740044)
Thanks for saying this, as I know a lot of people on HN have very negative feelings towards this trend. Personally, I feel the browser is a great way to stop reinventing the wheel, and the APIs abstract away a lot of the heavy lifting. They pretty much get you 80% of the way there, and the last 20% is where you can really add the stamp of "uniqueness" to your implementation.

The fact that the browser is also heavily sandboxed is another big benefit. I personally feel safer using a web app than a native app on any device, any day. You just don't know what a native app might be doing in the background, but with a web app, I feel things are much more transparent.

I can potentially see a future where you could deploy docker-like containers directly from the browser, while keeping the same fine grained controls that a browser allows. Then it really would make the web a truly flexible, infrastructure agnostic application delivery platform.

Re:TIL: You can access a user’s camera with just HTML by ryandrake on Tuesday September 06, 2022 @01:33PM (#32740317)
It just feels like every time software developers can't (or won't) build things cross-platform, users end up with bigger and bloatier solutions and poorer experiences.

First, it was cross-platform UI toolkits and OS abstractions like Qt (require users to use a big, "lowest common denominator compromise" library )

Then, it was web apps (require users to provide a browser)

Then, it was Electron and friends (ship the whole browser with the application)

Then, Docker and containers (ship the whole OS with the application)

Where do we go from here? Ship an entire physical PC to the user pre-loaded with the application? We keep trading away the end user's resources and convenience to gain developer's time and resources. All to keep (badly) solving the "Well, it works on my computer" class of problems.

Re:TIL: You can access a user’s camera with just HTML by madelyn on Tuesday September 06, 2022 @01:56PM (#32740641)
> Ship an entire physical PC to the user pre-loaded with the application?

A phone (hi iOS), a video game console, a smart appliance, etc. are examples of this.

Building cross platform, native applications is expensive (comparatively) to building web applications.

I made an FM synthesizer in the browser using WASM and the webaudio api just for personal use. I wouldn't have made it if I had to write it as a native app, because native apps are a time sink and annoyance to me (I mean, I'm on linux anyways. I probably have to use either GTK or QT anyways!!!)

Demand for software is MASSIVE right now, and making shipping easier, even if the end product isn't as fast, does have value.

Though yeah, I wish Slack was faster too.

Re:TIL: You can access a user’s camera with just HTML by MaxBarraclough on Tuesday September 06, 2022 @03:16PM (#32741877)
> A phone (hi iOS), a video game console, a smart appliance, etc. are examples of this.

Related to this: iirc, games for the Xbox One (and presumable the latest generation 'Series' consoles) always run in a VM, with their own kernel and graphics drivers.

Re:TIL: You can access a user’s camera with just HTML by water8 on Tuesday September 06, 2022 @03:54PM (#32742385)
Could be for backwards/intergenerational compatibility because and hardware is no longer standardized for a console generation
Re:TIL: You can access a user’s camera with just HTML by choeger on Tuesday September 06, 2022 @02:15PM (#32740903)
You're absolutely correct. IMO, the reason is, to a large degree, ineptness of software engineers. It simply doesn't pay to hire or train high-quality SEs, if you're not google or Amazon (and even they probably only hire and pay the best to prevent competition).

Instead, the industry as a whole hands out more "productive" tools, i.e., the abstraction layers you mentioned, in order to build ever more trivial applications (that don't work properly in most of the cases anyways).

I think that we're in a downwards spiral at this point: Business doesn't make enough money per line of code to hire or train really good engineers. Tries to push out more software, resulting in more crap. Software quality sinks. Business makes even less money per line of code. Engineers throw the towel and are replaced by less experienced people. Rinse and repeat.

Re:TIL: You can access a user’s camera with just HTML by jcynix on Tuesday September 06, 2022 @04:14PM (#32742628)
> You're absolutely correct. IMO, the reason is, to a large degree, ineptness of software engineers.

Hmm, software engineers? IMO the culprits are "greedy" managers who didn't like (and still don't like) common libraries, file systems etc. Motto: "It must be my standard, or else ..." Where's the common (license free and secure, encryptable) standardised file system, to exchange data between all platforms, including digital cameras and other gadgets? Where's the graphics API? Java tried to answer some of these questions, but failed miserably IMHO.

My experience: as soon as I learned to use some API or framework, at least two new APIs or frameworks showed up posing as the best thing since sliced bread. Sorry for the sarcasm, but I lost my optimism regarding software development some years ago.

Re:TIL: You can access a user’s camera with just HTML by gumby on Tuesday September 06, 2022 @03:05PM (#32741722)
I agree with what you wrote 99% but draw a different conclusion.

The 1% where I don't agree: most developers aren't engineers. These days companies hire engineers for stuff that is hard and important. But most do not need that.

And my impression is that that is a good thing. There's been a real democratization of development which means there's a lot of software being written. Most applications I see are fundamentally CRUD apps, and while I'm a bit fearful of the security of the banking apps, the massive frameworks are at least designed (implicitly at least) to reduce complexity and steer people towards some "best practices". Any kid today can build something that only a couple of decades ago (or less) really did need serious engineering.

We've followed the same path before. Rich people used to hire chauffeurs who didn't just drive but performed maintenance on the cars. Then people knew how to change tyres, gap their spark plugs etc. Now people know how to turn the key and steer around the road, hopefully not killing too many people in the process. Next, they'll only need to know how to step into the vehicle.

We should be glad software is going that way. It's not like that will reduce employment for engineers.

Re:TIL: You can access a user’s camera with just HTML by rektide on Tuesday September 06, 2022 @03:24PM (#32741995)
I see so much growth & positivity, so much can-do-ism. Everyone's doing great things, but in particular the web has brought about a much higher access to systems that seem much safer for users, much more sandboxed, with better tools/extensions/navigability/accessibility/hackability, that have much more open source activity going on than native (which has been to huge benefit in so many ways: to productivity, to learning, to exploring, to having fun, to creating social cultures & groups).

> I think that we're in a downwards spiral at this point

I'm mainly writing a reply just to say: I have huge hope we're on an great upward ascent & have made things increasingly better.

> IMO, the reason is, to a large degree, ineptness of software engineers.

I sometimes encounter less than optimal code or solutions, but the amount of times that it matters is unbelievably little. Focusing on really good engineers making really excellent decisions is, not, to me, a critical issue in most places. I think there's a lot of value in just finding the budget to support open source engineers, in trying to support good community efforts, like Web Incubation specs, like Bytecode Alliance. Time & care, about doing good things for community, over time, is the incomparable advantage, is the prime requirement of turning acceptable/passable/maybe-a-little-defect-y code into something that really works well & serves & is/has-become enduring.

> Instead, the industry as a whole hands out more "productive" tools, i.e., the abstraction layers you mentioned,

I see so little harm to using the good, well embraced, ultra productive, mid-industrial toolset we've grown into. And I see so little benefit to trying to go any other way. We should respect resource consumption, and some apps (webapp and native both) do bad jobs, but the layers mentioned seem like a vanish point of concern, far far far down where I think computing needs to be dwelling & caring & trying to do better. There's so few examples that there are real gains to be made from abandoning the layers we have; efforts like react-native show we can do basically the same high-production technioques at a native layer, but the rewards for doing it native have almost never materialized; just using the web stack continues to be good.

I think there are far more productive things to be debating & discussing, as we decide where to orient ourselves & the next steps of computing to. Worrying about these stacks has infected too much of the online discourse time spent, has become a mind-virus.

Re:TIL: You can access a user’s camera with just HTML by MereInterest on Tuesday September 06, 2022 @01:55PM (#32740625)
> Ship an entire physical PC to the user pre-loaded with the application?

I'm going to guess that there will be a few intermediate steps, with the additional goal of removing rights to your own computer.

After Docker and containers, an image for a virtual machine, to provide a kernel and not just the libraries.

After virtual machines, a connection to a remote machine, to avoid downloading the entire image and reduce your first-use bandwidth.

After connections to remote machines, a "co-located server", with an abstraction layer between using the remote machine to reduce first-use bandwidth and using the machine in your house to reduce latency.

Which is all to say that I wouldn't be surprised if it happened that way over the next 10-20 years, resulting in you renting the computer that sits in your own house.

Re:TIL: You can access a user’s camera with just HTML by ravenstine on Tuesday September 06, 2022 @02:33PM (#32741190)
> Then, Docker and containers (ship the whole OS with the application)

𝚃̶𝚘̶ ̶𝚋̶𝚎̶ ̶𝚏̶𝚊̶𝚒̶𝚛̶,̶ ̶𝚝̶𝚑̶𝚊̶𝚝̶'̶𝚜̶ ̶𝚜̶𝚑̶𝚒̶𝚙̶𝚙̶𝚒̶𝚗̶𝚐̶ ̶𝚝̶𝚑̶𝚎̶ ̶̶𝚔̶𝚎̶𝚛̶𝚗̶𝚎̶𝚕̶̶ ̶𝚊̶𝚗̶𝚍̶ ̶𝚗̶𝚎̶𝚎̶𝚍̶𝚎̶𝚍̶ ̶𝚙̶𝚊̶𝚌̶𝚔̶𝚊̶𝚐̶𝚎̶𝚜̶ ̶𝚠̶𝚒̶𝚝̶𝚑̶ ̶𝚝̶𝚑̶𝚎̶ ̶𝚊̶𝚙̶𝚙̶𝚕̶𝚒̶𝚌̶𝚊̶𝚝̶𝚒̶𝚘̶𝚗̶.̶ ̶ ̶𝚃̶𝚑̶𝚊̶𝚝̶'̶𝚜̶ ̶𝚙̶𝚎̶𝚍̶𝚊̶𝚗̶𝚝̶𝚒̶𝚌̶,̶ ̶𝙸̶ ̶𝚔̶𝚗̶𝚘̶𝚠̶,̶ ̶𝚊̶𝚗̶𝚍̶ ̶𝚠̶𝚑̶𝚒̶𝚕̶𝚎̶ ̶𝚠̶𝚑̶𝚊̶𝚝̶ ̶𝚢̶𝚘̶𝚞̶ ̶𝚜̶𝚊̶𝚒̶𝚍̶ ̶𝚒̶𝚜̶ ̶̶𝚝̶𝚎̶𝚌̶𝚑̶𝚗̶𝚒̶𝚌̶𝚊̶𝚕̶𝚕̶𝚢̶̶ ̶𝚝̶𝚛̶𝚞̶𝚎̶,̶ ̶𝚛̶𝚎̶𝚖̶𝚘̶𝚟̶𝚒̶𝚗̶𝚐̶ ̶𝚘̶𝚗̶𝚎̶ ̶𝚕̶𝚎̶𝚟̶𝚎̶𝚕̶ ̶𝚘̶𝚏̶ ̶𝚊̶𝚋̶𝚜̶𝚝̶𝚛̶𝚊̶𝚌̶𝚝̶𝚒̶𝚘̶𝚗̶ ̶𝚏̶𝚛̶𝚘̶𝚖̶ ̶𝚝̶𝚑̶𝚎̶ ̶𝚍̶𝚎̶𝚜̶𝚌̶𝚛̶𝚒̶𝚙̶𝚝̶𝚒̶𝚘̶𝚗̶ ̶𝚛̶𝚎̶𝚊̶𝚕̶𝚕̶𝚢̶ ̶𝚌̶𝚑̶𝚊̶𝚗̶𝚐̶𝚎̶𝚜̶ ̶𝚝̶𝚑̶𝚎̶ ̶𝚖̶𝚎̶𝚊̶𝚗̶𝚒̶𝚗̶𝚐̶ ̶𝚜̶𝚒̶𝚐̶𝚗̶𝚒̶𝚏̶𝚒̶𝚌̶𝚊̶𝚗̶𝚝̶𝚕̶𝚢̶.̶ ̶ ̶𝚃̶𝚑̶𝚎̶ ̶𝙻̶𝚒̶𝚗̶𝚞̶𝚡̶ ̶𝚔̶𝚎̶𝚛̶𝚗̶𝚎̶𝚕̶ ̶𝚘̶𝚗̶ ̶𝚒̶𝚝̶𝚜̶ ̶𝚘̶𝚠̶𝚗̶ ̶𝚒̶𝚜̶ ̶𝚜̶𝚘̶𝚖̶𝚎̶𝚝̶𝚑̶𝚒̶𝚗̶𝚐̶ ̶𝚕̶𝚒̶𝚔̶𝚎̶ ̶𝟷̶𝟶̶ ̶𝚖̶𝚎̶𝚐̶𝚊̶𝚋̶𝚢̶𝚝̶𝚎̶𝚜̶.̶

EDIT: What I've said is not exactly correct. If you're not running Docker on a Linux host, then you'll have a Linux kernel running in emulation but it's not shipping with containers. Not sure what I was thinking. I believe this is closer to the truth.

Re:TIL: You can access a user’s camera with just HTML by easrng on Tuesday September 06, 2022 @02:41PM (#32741318)
I thought docker used the host kernel with a different rootfs?
Re:TIL: You can access a user’s camera with just HTML by ravenstine on Tuesday September 06, 2022 @03:29PM (#32742063)
Apologies... I've been thinking in Docker For Mac Land. Yes, I think what you're saying is correct if you're running Docker on a Linux host.
Re:TIL: You can access a user’s camera with just HTML by cpuguy83 on Tuesday September 06, 2022 @02:45PM (#32741374)
Containers don't ship a kernel, just the userspace.
Re:TIL: You can access a user’s camera with just HTML by noduerme on Tuesday September 06, 2022 @02:24PM (#32741062)
>> Ship an entire physical PC to the user pre-loaded with the application?

Believe it or not, I've done this, and I have to maintain a small fleet of them now. The software in question functions as a server/database for a mobile app that's only used by employees on a given job site. It was deployed before Docker was a thing.

Re:TIL: You can access a user’s camera with just HTML by MR4D on Tuesday September 06, 2022 @01:45PM (#32740478)
> Ship an entire physical PC to the user pre-loaded with the application?

Ironically, that’s essentially what IBM did with mainframes.

Another example of what’s old is new again.

Re:TIL: You can access a user’s camera with just HTML by arghwhat on Tuesday September 06, 2022 @02:02PM (#32740723)
Eh? Mainframes are and always were general purpose computers, and run stufd like Linux just fine.

Nowadays they are mainly meant as machines with extreme reliability guarantees, from things like running multiple processors in lockstep to detect spontaneous processor errors, but they're still just computers.

While their cost makes them hugely impractical for .øst usecases, mainframes do have some really cool tech, including their new CPU designs with quite interesting cache layouts.

Re:TIL: You can access a user’s camera with just HTML by MR4D on Tuesday September 06, 2022 @02:23PM (#32741036)
I never commented on the specificity, rather I pointed out this quote "Ship an entire physical PC to the user pre-loaded with the application." Replace "PC" with "Mainframe" and the sentence was true (at least back when mainframes were a thing.

The software came pre-loaded with the hardware, and IBM shipped it to you and set it up for you. You couldn't buy an app without paying for the hardware. Technically, you rented everything from IBM, and paid one lease price.

Re:TIL: You can access a user’s camera with just HTML by arghwhat on Friday September 09, 2022 @01:23PM (#32782212)
That sounds more like a case of "you're buying an app for our mainframes, so you'll need something to run it on".
Re:TIL: You can access a user’s camera with just HTML by amelius on Tuesday September 06, 2022 @04:10PM (#32742571)
The problem with HTML is that it is not a layered technology. It's all or nothing.

And sadly it will get more complicated over time.

I just figured that at some point we should start over with a very simple sandbox that allows to run all the webgl renderers, javascript interpreters, css parsers, and whatnot, inside it. This simple sandbox would also be more secure, because of its simplicity.

Re:TIL: You can access a user’s camera with just HTML by rektide on Tuesday September 06, 2022 @03:07PM (#32741753)
Operating systems like WebOS, KaiOS/Firefox OS, ChromeOS largely do away with many layers of the stack, by making the web technology front & center. I do think you're right that perhaps some layers could go, but I think native apps & much of the native OS itself are far closer to the LaserDisc technology[1] that we can get rid of.

Reciprocally, on the server, there's definitely traction strong traction with webassembly being the de-facto platform for glue/extensions/user-code, owing to it's super sandboxing & capability systems like WASI. Being able to take any langauge, compile to wasm, and distribute & safely run that module has been a huge upgrade, and a very nice bit of platform that historically wasn't really available/commonplace on "native".

Your issue with "Electron and friends" is wrong. As you say, Electron does at present bundle a whole browser in each app. But many "friends" have new approaches. Tauri recently went 1.0, and generally builds off the already available WebView that all major OSes include[2]. I'd be interested to see what kind of fear/concern you'd present if Electron also had a more respectful shared-library usage-pattern.

[1] "Writing an App is Like Coding for Laserdisc" https://shkspr.mobi/blog/2022/09/writing-an-app-is-like-codi... https://news.ycombinator.com/item?id=32723192 (153 points, 1d ago, 184 comments)

[2] "Tauri [1.0] - Electron alternative written in rust" https://news.ycombinator.com/item?id=29807022 (558 points, 8mo ago, 419comments)

Re:TIL: You can access a user’s camera with just HTML by account-5 on Tuesday September 06, 2022 @02:29PM (#32741122)
I've being wondering about this myself for a personal project.

I don't want to have to code the project in multiple native languages, and likely wouldn't be able to without massive amounts of time learning each language.

Similarly I want access to native APIs, some of which browsers don't have. And I don't want to run a website to host my app.

I'm currently learning dart/flutter due to this. IMO it is the answer. You may disagree.

Re:TIL: You can access a user’s camera with just HTML by rafram on Tuesday September 06, 2022 @02:03PM (#32740729)
> Ship an entire physical PC to the user pre-loaded with the application?

Maybe not that, but it’s becoming popular to run high-intensity programs on a remote server and stream video to the user’s machine, both for pretty sensible reasons (e.g. Stadia for games) and totally nonsensical ones (e.g. Mighty for Google Chrome). It’s mainframes all over again!

Re:TIL: You can access a user’s camera with just HTML by _Algernon_ on Tuesday September 06, 2022 @03:17PM (#32741894)
The browser is inefficient. Use a modern website on a ten year old laptop and it is close to unusable because of modern web dev practices. That laptop is still perfectly usable for a lot of things.

The modern web drives obsolescence second only to gaming, but while gaming is user driven and entertainment focused (i.e. not essential), the web is megacorp driven and also includes necessary modern infrastructure.

That is all around a bad thing.

Re:TIL: You can access a user’s camera with just HTML by meltedcapacitor on Tuesday September 06, 2022 @03:52PM (#32742357)
"modern web practices" may be more to blame than the browser. It's possible to make lean fast things running on browsers (within reason), but the culture is nobody gets fired for bloat. It's ubiquitous, same for mobile apps, server side, etc.
Re:TIL: You can access a user’s camera with just HTML by account42 on Wednesday September 07, 2022 @04:52AM (#32748216)
The browser is responsible for providing web developers with ever-increasing resources to eat up. It also defers way an increasing amount of much functionality to javascript (or at least allows javascript to reimplement that functionality) - e.g. there is no native support for DASH video so you are always beholden to whatever js the website uses (unless you want to use website-specific hacks).
Re:TIL: You can access a user’s camera with just HTML by loudmax on Tuesday September 06, 2022 @03:52PM (#32742363)
There's no desktop standard. Desktop operating systems are either proprietary or niche. Any application you write needs to be ported again to each operating system separately.

The web is the closest thing there is to a ubiquitous operating system. And with the development around WASM, performance and efficiency is getting closer and closer to native. That's along with built-in security and sandboxing.

This is all around a good thing.

Re:TIL: You can access a user’s camera with just HTML by PaulDavisThe1st on Tuesday September 06, 2022 @01:56PM (#32740634)
> Personally, I feel the browser is a great way to stop reinventing the wheel

This is an optimistic take on the near- and mid-term evolution of software. What makes you think that working inside the browser will stop wheel reinvention? Have you not tracked the endless reinvention of "the right way" to do interactive app development inside the browser?

Re:TIL: You can access a user’s camera with just HTML by bonestamp2 on Tuesday September 06, 2022 @01:45PM (#32740476)
If I understand you comment correctly, WebAssembly is on a path to give you that web based container that can be as powerful as your computer allows while still being sandboxed in the browser.
Re:TIL: You can access a user’s camera with just HTML by psychoslave on Tuesday September 06, 2022 @02:18PM (#32740956)
Re:TIL: You can access a user’s camera with just HTML by merelysounds on Tuesday September 06, 2022 @12:28PM (#32739432)
> I personally _love_ how the browser is becoming a very well-featured sandbox for shipping applications.

Same.

My latest project is a waveform generator for wavetable synthesizers [1]; there are visualizations, as well as handling audio (not real time but still). I was surprised that I could build that as a web app and achieve good UX and performance.

[1]: https://merely.xyz/waves

Re:TIL: You can access a user’s camera with just HTML by gofreddygo on Tuesday September 06, 2022 @01:02PM (#32739919)
I know nothing about this. It looks cool. I want to learn more. Where do I start ?

DDG search does not help much [1], [2]

Any pointers ?

1: https://duckduckgo.com/?q=waveform+generator+for+wavetable+s...

2: https://duckduckgo.com/?q=wavetable+synthesizers&ia=web

Re:TIL: You can access a user’s camera with just HTML by comboy on Tuesday September 06, 2022 @01:42PM (#32740430)
Re:TIL: You can access a user’s camera with just HTML by angrygoat on Tuesday September 06, 2022 @12:51PM (#32739769)
This is very cool, although I was just playing around with it and my cat cast me a filthy look and raced away at high speed. Your warning about playing the sounds is well given! :)
Re:TIL: You can access a user’s camera with just HTML by srcreigh on Tuesday September 06, 2022 @12:31PM (#32739477)
You’re down. I want to see your site! When can I see it?

And your domain is really cool too. I presume it’s like a self deprecating math joke.

Re:TIL: You can access a user’s camera with just HTML by merelysounds on Tuesday September 06, 2022 @12:37PM (#32739570)
I had a typo in url (wrote .xys instead of .xyz, fixed now), thanks for letting me know.

The .xyz pun was not intended, but it does make a lot of sense for a math related app. Thanks for spotting that too!

Re:TIL: You can access a user’s camera with just HTML by srcreigh on Tuesday September 06, 2022 @12:47PM (#32739714)
Cool! some early feedback:

- Very hard for me to find the play button.. took like 10s of looking. I looked at the segment buttons

- Accidentally, I got some really cool sounds by mashing the play button to overlay it. Not sure why it gets distorted if it should be playing the same waves. But it sounds cool

Re:TIL: You can access a user’s camera with just HTML by coupdejarnac on Tuesday September 06, 2022 @03:43PM (#32742239)
I love the Fourier transform animation.
Re:TIL: You can access a user’s camera with just HTML by fsckboy on Tuesday September 06, 2022 @04:36PM (#32742858)
you should talk/reference a bit more about the fourier transform aspect https://www.geogebra.org/m/t9uspumz
Re:TIL: You can access a user’s camera with just HTML by amalcon on Tuesday September 06, 2022 @01:15PM (#32740076)
I recognize that this kind of thing is useful to the developer, of course, and we've gotten a lot of neat things this way.

My worry is basically that the absent functionality is the best thing about the web as a user. Take the notification API: One of the nice things about web pages and apps is that they stop bothering me once I close them; not so if I accidentally permit notifications! Fortunately I can turn that whole feature off, but at first I found myself wondering who ever thought that would be a good idea.

Yes I picked an extreme example, and I don't actually mind some of these things. I wish there were a permission pop-up before playing sound at all. Also, WebGL does concern me, since heavy GPU usage can draw a lot of power. Things like gamepad support and spatial audio (if they are behind permission pop-ups) don't really bother me, though.

Re:TIL: You can access a user’s camera with just HTML by johnfn on Tuesday September 06, 2022 @01:18PM (#32740112)
I don't know, this seems like a good compromise to me. Some apps (calendar) would be absolutely crippled without them. For everything else, I've just never turned them on in the first place.

> I wish there were a permission pop-up before playing sound at all

The browser can't actually play sound unless 1) it's triggered as the result of a user action (such as a mouse click) or 2) if you've often listened to sound on that page in the past.

Re:TIL: You can access a user’s camera with just HTML by amalcon on Tuesday September 06, 2022 @01:29PM (#32740272)
My answer to this is that the calendar just does not need to be a web app. Weakening a primary advantage of everything else on the web just so that my calendar can be a web app seems like a poor trade-off.

Re: sound, "Triggered as the result of a user action" is not a high enough bar.

Re:TIL: You can access a user’s camera with just HTML by lcnPylGDnU4H9OF on Tuesday September 06, 2022 @01:50PM (#32740548)
> the calendar just does not need to be a web app

And the chat app, and the email app, and the social media app (other opinions about social media notwithstanding). I think each of these things have their own legitimate use for notifications.

I guess it's the point of "weakening a primary advantage". I don't see how it's weakened (or rather, I don't see how it's a problem) when the notifications are on a per site permission. Especially so when the notifications can be turned off completely per browser.

> Re: sound, "Triggered as the result of a user action" is not a high enough bar.

I'm with you on this. Although it took until this thread for me to realize that sound at all should be a permission.

Re:TIL: You can access a user’s camera with just HTML by account42 on Wednesday September 07, 2022 @05:03AM (#32748270)
The world would be better off if social media apps did not have notifications.
Re:TIL: You can access a user’s camera with just HTML by shadowgovt on Tuesday September 06, 2022 @02:05PM (#32740768)
Calendars are far more useful as web apps than other incarnations; you can open them anywhere and don't have to carry a specific artifact with you to do it.
Re:TIL: You can access a user’s camera with just HTML by dijit on Tuesday September 06, 2022 @02:40PM (#32741292)
a web view for caldav is just fine (and how I use outlook currently); but for notifications a proper program is definitely preferable.
Re:TIL: You can access a user’s camera with just HTML by nathants on Tuesday September 06, 2022 @03:18PM (#32741908)
the flashing/buzzing/squawking device in your pocket does this quite well.
Re:TIL: You can access a user’s camera with just HTML by account42 on Wednesday September 07, 2022 @05:00AM (#32748260)
> The browser can't actually play sound unless 1) it's triggered as the result of a user action (such as a mouse click) or 2) if you've often listened to sound on that page in the past.

The point is that a click should not give the website permission to play audio - that should be handled much explicitly and not just the user selecting text or some other interaction. Besides, last time I checked Firefox still let AudioContext play sound without any user interaction even though the <audio> element has more restrictions. Which is another problem: the HTML + JS spec is too bloated to properly secure things.

Re:TIL: You can access a user’s camera with just HTML by notatoad on Tuesday September 06, 2022 @01:33PM (#32740318)
this seems like a pretty silly criticism - you have a feature that is both gated behind a per-site permission prompt and that has an option to globally turn it off, and you're still grumpy that it exists?

if you don't like it turn it off. arguing that things shouldn't exist just because you choose not to use them is pretty selfish.

Re:TIL: You can access a user’s camera with just HTML by amalcon on Tuesday September 06, 2022 @01:47PM (#32740510)
I mean... it does exist now, and I don't advocate taking it out since people have probably come to rely on it for some reason. Defaults matter, though, and I suspect[0] that a minority want this default.

[0]- With only anecdotes supporting my suspicion; I haven't done a rigorous study.

Re:TIL: You can access a user’s camera with just HTML by lupire on Tuesday September 06, 2022 @03:37PM (#32742167)
It seems silly to ask for a release to be crippled just because a page does something obnoxious inside its own space. The solution to that is a URL allowlist or blocklist.
Re:TIL: You can access a user’s camera with just HTML by cyral on Tuesday September 06, 2022 @12:21PM (#32739303)
And theres a LOT more APIs than people realize: https://developer.mozilla.org/en-US/docs/Web/API

Some interesting ones:

- Screen recording/capture

- Battery status

- Barcode Detection

- Bluetooth

- Sensors (e.g. Accelerometer)

- Wake/screen lock

- Color picker

- Vibration

- MIDI

- USB

- Contacts picker

- Presentation (AirPlay, Chromecast)

- Virtual reality

Re:TIL: You can access a user’s camera with just HTML by lucideer on Tuesday September 06, 2022 @12:30PM (#32739473)
These are all Javascript APIs. I think what's particularly notable about the OP is that it's HTML.
Re:TIL: You can access a user’s camera with just HTML by cyral on Tuesday September 06, 2022 @01:14PM (#32740070)
Yes but the person I'm replying to is talking about JS APIs
Re:TIL: You can access a user’s camera with just HTML by spaghettiToy on Tuesday September 06, 2022 @03:08PM (#32741763)
I'm here for the JS comments.

I'm amazed at how quickly I can throw together a front end feature in JavaScript on my otherwise html site.

Really all of web impressed me over the desktop/app counterparts. I wrote and read to/from a php database with less than 2 hours of time. Laravel has me doing user authentication + useful coding in less than 40 hours after the tutorial.

Re:TIL: You can access a user’s camera with just HTML by naillo on Tuesday September 06, 2022 @12:49PM (#32739737)
Old enough to remember when the accelerometer didn't require permission to access.
Re:TIL: You can access a user’s camera with just HTML by codethief on Tuesday September 06, 2022 @01:48PM (#32740525)
Me too but I'm glad it does now and I don't have fear (web) apps that exploit the accelerometer as microphone.
Re:TIL: You can access a user’s camera with just HTML by adrr on Tuesday September 06, 2022 @02:57PM (#32741573)
It was useful an API to detect if a client was faking their user agent or was a bot. When I worked for a neo bank we abuse all the APIs to detect if client was a real person or not without having to use captchas.
Re:TIL: You can access a user’s camera with just HTML by dheera on Tuesday September 06, 2022 @12:56PM (#32739846)
Yeah you could use the vibration API and accelerometer API as a very low bitrate TX/RX system for devices on the same table and close enough.

No permissions required.

Re:TIL: You can access a user’s camera with just HTML by chrisweekly on Tuesday September 06, 2022 @01:25PM (#32740218)
I vaguely recall there being some early-days accelerometer-based webapps that absolutely destroyed batteries, because the high-resolution accelerometer checks required responsible throttling / debouncing. So gating it behind permissions makes some sense to me.
Re:TIL: You can access a user’s camera with just HTML by whywhywhywhy on Tuesday September 06, 2022 @02:32PM (#32741171)
USB/Bluetooth is underrated because it means you can ship hardware products that can have their firmware updated or connect and sync with a web service without having to build/ship/maintain a whole app for it that will eventually stop working after an OS update.
Re:TIL: You can access a user’s camera with just HTML by david12345 on Tuesday September 06, 2022 @04:52PM (#32743049)
Hell, you can even root an android phone via the browser! https://protonaosp.org/install/web
Re:TIL: You can access a user’s camera with just HTML by spaghettiToy on Tuesday September 06, 2022 @03:03PM (#32741697)
Is Bluetooth good yet?

I had issues as recent as last year's new products.

But otherwise I love the concept of hardware access with HTML. The embedded guy in me thinks the future is going to be crazy. I can't quite wrap my head around the possibilities.

Re:TIL: You can access a user’s camera with just HTML by autoexec on Tuesday September 06, 2022 @06:01PM (#32743775)
My guess is that hardware access with HTML will mostly bring about remote exploits and massive privacy problems. I disable all of it.

I also keep Bluetooth disabled on my mobile devices. It's used extensively to ID and track people and their devices. For things that don't move and are only ever paired to a single thing (like a speaker) it works fine. Most of the complaints I hear about bluetooth are from people who pair multiple devices to a single source and want to easily switch between them.

Re:TIL: You can access a user’s camera with just HTML by shusaku on Tuesday September 06, 2022 @12:25PM (#32739379)
Any former geocities member us surely aware of the MIDI capability!
Re:TIL: You can access a user’s camera with just HTML by monocasa on Tuesday September 06, 2022 @12:35PM (#32739529)
Not just playing MIDI files, but interfacing with MIDI controllers (including ones that weren't designed to be accessible over the web leading to RCE).
Re:TIL: You can access a user’s camera with just HTML by andyhedges on Tuesday September 06, 2022 @12:31PM (#32739486)
Couldn't you play a WAV too? But they were too massive at the time for most peoples bandwidth.
Re:TIL: You can access a user’s camera with just HTML by mattl on Tuesday September 06, 2022 @02:16PM (#32740919)
<bgsound>
Re:TIL: You can access a user’s camera with just HTML by tinus_hn on Tuesday September 06, 2022 @01:16PM (#32740091)
Unfortunately many of these leak identifying datapoints so due to abuse they are now blocked.
Re:TIL: You can access a user’s camera with just HTML by megous on Tuesday September 06, 2022 @12:36PM (#32739544)
Most of these are not available in chrome or firefox.
Re:TIL: You can access a user’s camera with just HTML by easrng on Tuesday September 06, 2022 @02:46PM (#32741398)
A lot of those are Chrome-only.
Re:TIL: You can access a user’s camera with just HTML by dahfizz on Tuesday September 06, 2022 @03:16PM (#32741881)
I love the idea of a good cross platform sandbox to ship apps. I think it's really unfortunate that we chose a web browser to be that application platform.

The underlying technology is terrible. HTML and CSS are for displaying documents. Things which should be trivial to add to an application UI (add a ListView, anchor element X to be left of element Y, etc) are nigh impossible without using some bloated toolkit anyway. JS is a slow and brittle language to work with.

The fact that the web became an application delivery platform is an unfortunate historical accident that I am not sure we can recover from.

If we devoted 10% of the engineering that went into "web technology" into an actual dedicated cross platform application platform, it would be way better than the web is today. Faster, less bloat, better technology so that we don't need frameworks on frameworks to do a hello world, etc.

Re:TIL: You can access a user’s camera with just HTML by lmkg on Tuesday September 06, 2022 @03:22PM (#32741963)
There is a possible future where HTML and JavaScript are relegated to historical shims for WASM and <canvas>. I don't know if this is a good future or not, but you want a future with cross-platform apps freed from "web technologies" that's probably the one that's most achievable from the state of things today.
Re:TIL: You can access a user’s camera with just HTML by robotnikman on Tuesday September 06, 2022 @12:25PM (#32739387)
One thing I miss about adobe flash was the software available to create flash games and animations. It was relatively easy to use and felt like it had a good combination of graphical tools and scripting to allow you to create what you wanted

I wish there was something similar for but for modern browsers, taking advantage of HTML5 and all the browser API's available now which previously required a plugin like adobe flash.

As you mentioned the API's and capabilities are there, built right into the browsers now. I just wish the tooling was better.

Re:TIL: You can access a user’s camera with just HTML by codetrotter on Tuesday September 06, 2022 @12:47PM (#32739713)
The Adobe Flash authoring software has a successor called Adobe Animate. I’ve only ever exported to MP4 video files with Animate, but I know Animate has some HTML5 export options. But I don’t know how comfortable it would be to use for creating graphics and animations for actual JavaScript games and/or web applications.
Re:TIL: You can access a user’s camera with just HTML by lucideer on Tuesday September 06, 2022 @12:29PM (#32739456)
100%

And also doing this declaratively makes it so much easier to secure & build well-thought-out privacy & consent UX around.

An imperative API has so many variations on implementation approach for the end-developer / API consumer that the combinatorics become much more challenging for browser implementers.

(obviously imperative APIs for doing this already exist, but the existence of this declarative API at least makes limiting imperative API access less draconian/severe as a measure).

Re:TIL: You can access a user’s camera with just HTML by LAC-Tech on Tuesday September 06, 2022 @01:58PM (#32740669)
I personally _love_ how the browser is becoming a very well-featured sandbox for shipping applications.

For me the big thing holding it back is IndexedDB.

Actually in the process of designing a software solution that needs to work on desktop and mobile, and be able to write mission critical data while offline.

As much as I'd love to just make one responsive web app - I just can't trust the safari or even chrome browsers to not /dev/null users data if it feels like it.

Re:TIL: You can access a user’s camera with just HTML by na85 on Tuesday September 06, 2022 @04:18PM (#32742666)
>A lot of totally valid opinions out there about this, but I personally _love_ how the browser is becoming a very well-featured sandbox for shipping applications.

Unfortunately what's convenient for you as a developer is more often than not hostile and awful UX for me as a user.

Too often, developer convenience trumps good UX.

Re:TIL: You can access a user’s camera with just HTML by croes on Tuesday September 06, 2022 @12:19PM (#32739271)
>because browsers really don't want you to own _every_ key.

Wouldn't be really a sandbox anymore if they could

Re:TIL: You can access a user’s camera with just HTML by secondcoming on Tuesday September 06, 2022 @12:41PM (#32739634)
Why would anyone want, or let, a webpage assume full control of their keyboard?
Re:TIL: You can access a user’s camera with just HTML by Waterluvian on Tuesday September 06, 2022 @03:28PM (#32742056)
Me, because I want to see how much I can make a web browser video game feel like a native game.

Other than that... I'm not sure even I'd want to allow a webpage to do that.

Re:TIL: You can access a user’s camera with just HTML by dekhn on Tuesday September 06, 2022 @12:54PM (#32739818)
ssh terminal
Re:TIL: You can access a user’s camera with just HTML by z3t4 on Tuesday September 06, 2022 @12:52PM (#32739779)
If you make a manifest file and listen to the install event users can add your game to their home screen. Aka. PWA. Then you can listen to most keys! Works for chrome on desktop and all major mobile browsers. Safari don't have the install event and need to be "installed" manually

I have made a web editor that uses this. There is an example pwa app Https://webide se/

Re:TIL: You can access a user’s camera with just HTML by coding123 on Tuesday September 06, 2022 @01:23PM (#32740183)
The thing I don't like about the browser becoming that is that every web page will now have tons of prompts. Something we were trying to kill off with IE years ago because too many people just click "accept".

The thing I like about it is what you just said.

Re:TIL: You can access a user’s camera with just HTML by dekhn on Tuesday September 06, 2022 @12:45PM (#32739685)
I used to think the browser could be a sandbox, but its evolution to one has been mighty slow- decades to pick up some basic features any desktop application developer has been able to take advantage of, easily, for decades.
Re:TIL: You can access a user’s camera with just HTML by valenterry on Tuesday September 06, 2022 @02:06PM (#32740777)
Yes!

And that's much better than Apps, where you are forced into an unfavorable ecosystem.

Re:TIL: You can access a user’s camera with just HTML by mkl95 on Tuesday September 06, 2022 @12:28PM (#32739430)
WebGPU feels like a godsend, I hope it gains popularity ASAP.
Re:TIL: You can access a user’s camera with just HTML by Waterluvian on Tuesday September 06, 2022 @03:31PM (#32742097)
Yeah!

Any time I've tried to use WebGL... pain.

Re:TIL: You can access a user’s camera with just HTML by rgersten on Tuesday September 06, 2022 @03:31PM (#32742098)
Any chance you’re blogging about the process? I’d love to follow along, as I dream of doing the same thing one day.
Re:TIL: You can access a user’s camera with just HTML by Waterluvian on Tuesday September 06, 2022 @03:35PM (#32742133)
I really really should. I want to un-abandon my home page and maybe start writing about it there. FWIW the code is here: https://github.com/ablakey/kestrel
Re:TIL: You can access a user’s camera with just HTML by johnfn on Tuesday September 06, 2022 @01:14PM (#32740064)
We're certainly veering off-topic, but I'd love to hear about which game engine you ended up using!
Re:TIL: You can access a user’s camera with just HTML by Waterluvian on Tuesday September 06, 2022 @03:27PM (#32742045)
Because the entire point is to learn and not actually to ship a product, I wrote my own. The biggest libraries I use that I didn't write are HowlerJS for audio, PixiJS for graphics, and React for UI. The actual "game engine" is a very primitive one I wrote myself. You can see it here: https://github.com/ablakey/kestrel/blob/master/src/Engine.ts

One of the best things about NIH-ing my own engine is that I don't need to make it generic, meaning one less layer of abstraction to complicate implementation and debugging.

Re:TIL: You can access a user’s camera with just HTML by djbusby on Tuesday September 06, 2022 @01:02PM (#32739926)
Are you using A-Frame?

https://aframe.io/

Re:TIL: You can access a user’s camera with just HTML by Waterluvian on Tuesday September 06, 2022 @03:29PM (#32742065)
Wow that's snazzy! But no, I'm using PixiJS because my game is 2D.