Remix.run Logo
NooneAtAll3 3 hours ago

> Don't roll your own page scrolling.

browser should not even let the page see this action

> Don't roll your own link navigation.

browser should not even let the page see this action

> Don't roll your own text selection.

browser should not even let the page see this action

> Don't roll your own copy and paste.

browser should not even let the page see this action

I'm serious. WHY javascript code is even allowed to see all these actions of the user? We already loaded the page and rendered it - we users must already be free to do with the content as we please

wasmperson an hour ago | parent | next [-]

> WHY javascript code is even allowed to see all these actions of the user?

scrolling: used by games, maps, image viewers

link navigation: used for client-side routing (youtube/twitch, any website with a chat window)

text selection and copy/paste: word processors, spreadsheet editors, forum software, etc.

I'm not sure if your question was sincere or if you were trying to say that the web should not support these use cases.

gyomu 18 minutes ago | parent | next [-]

Yes, you get to the heart of the problem - we turned what started of as a document viewer into a general purpose application platform.

Features paramount in a document viewer (broadly, "respect the user's local document viewing preferences") aren't desirable in a general purpose application platform.

A large number of companies/web developers don't think of themselves as offering the user a document to view on their own terms, but rather an "experience" that they want full control over (which means, most of the time: show ads and record user behavior).

If you're offering me a game, fair enough. But if you're showing me my hotel reservation or electric bill, I want a document, not an ""experience"".

jason_oster 18 minutes ago | parent | prev [-]

On the extreme end, a web app can do all of its own rendering in a canvas with WebGL/WebGPU. Some apps do exactly this: Figma, Google Maps, Google Docs. Just to name a few. (edit: Earlier I claimed PDFjs uses canvas, but it does not. I was confusing it with Google Docs [1].)

It's a thing you can do. But it is very bad for extensions and extension developers for the same reasons that Java applets, Flash, and Shockwave were bad for the web. These apps are difficult for end users to customize. It's a real bane to tinkerers. And it's a shame that "view source" has slowly grown completely useless over the decades.

[1]: https://workspaceupdates.googleblog.com/2021/05/Google-Docs-...

incr_me 3 hours ago | parent | prev | next [-]

Because the web browser was burdened with the role of application host, and not just presentation of static content. There's no going backwards.

trueno 2 hours ago | parent | next [-]

this is why the web stack feels like a car held together with duct tape these days. we collectively took the wrong fork in the road and doubled, tripled, and quadrupled down. computing in general is glorious when i feel like im working near computing and then i get to web app stuff and im like.. i dunno. sad. i get why we ended up where we did with web stacks but seriously what a nightmare

jay_kyburz 33 minutes ago | parent | prev [-]

rss

js2 3 hours ago | parent | prev | next [-]

All of these annoyances and more can be blocked by StopTheMadness (available for iOS and macOS):

https://underpassapp.com/StopTheMadness/

orhmeh09 2 hours ago | parent | next [-]

This is one of the most useful programs I use every day. Works in Firefox too

NooneAtAll3 2 hours ago | parent | prev [-]

> Sold separately

aaaand you lost my interest the moment money got involved

all these things are already fixable by browser extensions - what is lacking is exposing that in browser options and even making it the default

ladberg 24 minutes ago | parent | next [-]

Do you not believe developers should be paid for the work they do? And if not, what do you think the majority of people on this forum do?

latexr an hour ago | parent | prev [-]

> all these things are already fixable by browser extensions

Which is what StopTheMadness is and does.

tecoholic an hour ago | parent | prev | next [-]

> WHY javascript code is even allowed to see all these actions of the user? We already loaded the page and rendered it

Nope we haven’t. At least not in a web application. At least not since the days Infinite Scrolling was invented. IIRC Twitter, for eg, only renders a partial list depending on the scroll position.

I once wrote a NER tagger, where implementing custom text selection allowed users to not stress about selecting the exact word boundaries when manually tagging 1000s of words per day.

I can probably find legitimate use cases for almost of these things in the list. While I agree with the broader theme of the article, this idea that the user agent should be a dumb display is not valid.

andai 2 hours ago | parent | prev | next [-]

I found that most internet pages are greatly enhanced by disabling JavaScript in my web browser.

Shellban 2 hours ago | parent | next [-]

It depends. A lot of websites refuse to display some stuff without JavaScript, and of course online payments insist on JavaScript (to the point that trying to push through without it can result in strange errors and potential double-charges as you troubleshoot).

NooneAtAll3 2 hours ago | parent | prev [-]

total disabling of JS is overkill

I mean, I'm all for for switching to Lua or smth (which is a slightly different anti-JS camp than yours), but the problem isn't in interactive (or even non-frozen) pages in general - it's in pages reading user actions that user doesn't expect/want to

vitally3643 3 hours ago | parent | prev | next [-]

It should be illegal for a website to hijack text copying, right clicking, or keyboard shortcuts like Ctrl*f.

VladVladikoff 2 hours ago | parent [-]

No. There are already too many batshit insane laws trying to regulate the internet. We need less, not more.

equinoxnemesis 2 hours ago | parent [-]

Indeed, people talk about technical solutions to social problems but there is also such a thing as trying a legal solution for a technical problem.

crq-yml an hour ago | parent | prev | next [-]

The Web is an ads platform with useful functionality as bait.

That's all there really is to it: Mosaic added image support. Investors got excited and asked if the images could animate, if they could record click data and credit card data, if they could add video and additional presentational elements. Holistic user experiences were secondary.

To move forward we have to accept that most of this wasn't an accident and it needs some breaking changes.

GolfPopper an hour ago | parent | prev | next [-]

>WHY javascript code is even allowed to see all these actions of the user? We already loaded the page and rendered it - we users must already be free to do with the content as we please

Because on the modern web, the user is the content, sold to the highest bidder.

jakevoytko an hour ago | parent | prev | next [-]

Applications like Google Docs would be impossible without each of the four things you listed being available. We had Google Docs that didn’t roll-your-own for each of the items in that list and it was called Writely and it was absolute dogshit (but super cool for its time) because those limitations were too extreme. And by extension it wouldn’t make sense to have Chromebooks as a category of hardware, because web software could never compete at a feature parity level with native software.

at_compile_time 38 minutes ago | parent | next [-]

Seems like exactly the kind of thing permissions are for.

BrenBarn 41 minutes ago | parent | prev [-]

I would rather not have Google Docs than have all the other crap that comes along with allowing every website to do stuff that Google Docs "needs".

msla 2 hours ago | parent | prev | next [-]

> WHY javascript code is even allowed to see all these actions of the user?

Because the alternative is UI/UX Designers and Visionary Managers insisting on keeping Flash and Java Applets and Microsoft Visual Silverlight .Net++ around forever, because you can't do some things in the browser and We Need To Do Them.

Some things have minimal complexity that either lives in the language itself or in libraries. The Web has minimal bells and whistles that are either implemented in the browsers itself or in plugins.

king_geedorah an hour ago | parent [-]

Nobody “needed” the web to do these things. We decided that the effort and cost of making native applications was too great. I’d argue we went the wrong way given that even the same browser will exhibit slightly different behavior depending upon the underlying platform upon which it runs.

bigstrat2003 3 hours ago | parent | prev | next [-]

Also: Javascript should not be able to touch the browser history. I know it's useful for some apps. But it's too prone to abuse and that API should be revoked.

NooneAtAll3 2 hours ago | parent [-]

my main argument against this has been reading books

I don't enjoy needing to "go back" 100 times, once for each page of the book just to return to f.e. search results I opened the book from

manoDev an hour ago | parent | prev [-]

Javascript was a mistake.