> 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
Because the web browser was burdened with the role of application host, and not just presentation of static content. There's no going backwards.
All of these annoyances and more can be blocked by StopTheMadness (available for iOS and macOS):
I found that most internet pages are greatly enhanced by disabling JavaScript in my web browser.
It should be illegal for a website to hijack text copying, right clicking, or keyboard shortcuts like Ctrl*f.
> 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.
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.
Desktop envy: so you could create certain desktop-like interactions.
>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.
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.
Javascript was a mistake.
> 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.
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.
> 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.