Opened 7 weeks ago

Last modified 6 weeks ago

#19142 new enhancement

Option to disable JavaScript - ideally one click button

Reported by: slema Owned by: pulkomandy
Priority: normal Milestone: Unscheduled
Component: Applications/WebPositive Version: R1/beta5
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

In Falkon if you enable the “StatusBar Icon” extensions you get a bunch of small icons at the right of the status bar at the bottom. One of them allows enabling / disabling JavaScript temporarily. Since WebPositive targets all computers supported by Haiku including old one it would benefit greatly from this.

On an old machine such as a Core 2 Duo unknowingly hitting the wrong web page can bring the machine to a massive slowdown due to asburdly heavy JavaScript code. These old machines just cannot handle today’s web. So it makes more sense to browse with JavaScript disabled and enable it case by case only on sites you trust.

Change History (8)

comment:1 by nephele, 7 weeks ago

Keywords: JavaScript slow removed

I am in favor of having an opt-in js mode for pages.

However some of the weight is advertisements, blocking it in general already yields madsive improvements for older computers.

On another note: we do not support *all* computers haiku runs on with webpositive. Currently we only support computers with SSE2 atleast.

AFAIK this is also because of the javascript JIT. perhaps a js-less version could be made compatible.

However: netsurf is available for those older computers aswell.

comment:2 by slema, 7 weeks ago

NetSurf is great but the rendering of html+css is very far behind what WebKit can do. Also JavaScript is an option in the settings so it’s tedious to enable it when you need it.

Aside from absolutist attitude towards JavaScript I believe a lot of use ability can come from per-page / site choices. Ideal when JavaScript is off in settings we’d have a button in the bottom bar to allow with one or two clicks to enable : “JavaScript from this domain”, “JavaScript from other domains”, ideally with the size in kb on the side and to be able to white list a site for JS.

But of course as a start a one click on/off button for JavaScript would help a lot. You can experience this with Haiku forums for example: a site we would trust because it uses minimal JavaScript but we wouldn’t want it on by default when randomly browsing the web on a Core 2 Duo. When you don’t know what you’re going to view it’s literally JS Russian Roulette. Same goes for auto play in video: inoffensive on a modern machine but ruins the experience on an old machine.

Not sure it’s the same on Haiku but on qtwebengine there is literally one call to enable / disable JS on a web page.

comment:3 by slema, 7 weeks ago

This is a bit beyond the scope of this ticket so sorry if it’s wrong (?) to mention it here but I think one way WebPostiive (and others) could lead the web to cleaning back up part of the web was if the status bar in a page could emit opinion on the weight of a webpage out of the box. Like count the size of page, the size of JS and display either a 🟢 green dot “small web” or an orange, or red dot 🔴 for heavy stuff.

comment:4 by nephele, 7 weeks ago

I doubt any such indicators would have an impact on website authors given the small user base of Haiku. Having first vs thirs party assets and js would be a good idea. Just gotta make sure this is a nice "permissive" UI, instead of the constant popups for permissions for every little thing as on other browsers ;)

comment:5 by pulkomandy, 7 weeks ago

Some browsers just show the number of megabytes downloaded while loading a webpage. That's not a bad idea. However we should probably discuss it in a separate issue :)

comment:6 by alterae, 7 weeks ago

i do think even for newer machines the ability to easily toggle JavaScript would be good for privacy/security, while still making it easy to use sites that require it when necessary

additionally, on older/slower machines (including ones officially supported by WebPositive) or on slow or limited network connections, the ability to disable JavaScript is a huge usability advantage, and it would be very nice to have such a feature in a browser with a modern rendering engine (NetScape, as mentioned above, struggles to properly render many relatively simple pages)

per-site settings would be excellent, but even a global easily-accessible toggle would be extremely useful

comment:7 by slema, 6 weeks ago

Minimal implementation including search

It would be a good first step to add a quick on/off button for javascript. Somewhere permanent on screen. I guess on the status bar at the bottom. Definitely no popups indeed, just a one click switch so it's not tedious or annoying for those who don't want to know about it.

Note that once javascript is disabled it's important to use the noJS version of search engine in the search box (https://html.duckduckgo.com/html and alike) so the experience is not immediately frustrating for the user when JS is off. Either that or whitelisting search engines as autocompletion with JS is nice and that alone would not kill a slow machine.

More features around smolweb for later:

There are lots of other possibilities that will deserve their own tickets. Stuff like:

  • showing the total size of the page (text / javascript / images)
  • whitelisting pages or domains to allow JS
  • setting a limit of size for allowed JS, like drop everything about 50kb.

The status bar button could show just JS: ON or JS: OFF with an eventual icon indicating the weight category of the page (a feather or an anvil) and the toolTip could show more detailed info about why this page is heavy:

Something like:

  • Text Content: 28kb
  • Javascript: 780kb
  • Ratio of actual content: 3%
  • Light Web score: 💩💩💩

Or a more elegant scoring mechanism but you get the idea :-)

I know Haiku has a small community and that's why I said "lead the web" because sometimes all you need is a working example for others to notice and imitate. Maybe some reviewer of Haiku will launch WebPositive and think it's nice that the default web browser warns about heavy web pages. And maybe someone working on Gnome will want to imitate it and someone at Google will definitely not.

Haiku is niche but WebPositive is the default browser on this platform so it can maybe be an influencer on its level. That's also perfectly in line with the lean & mean philosophy of the operating system. I think it's a rather important thing to underline that the reason we can't use old computers today is not because we have more content but because of what has been creeping on top of our content. It is not so evident for non-technical people.

comment:8 by nephele, 6 weeks ago

Showing sizes for such stuff is something we can do, sure. But scoring systems don't make any sense to me. A score is a subjective thing. Why would the limit for a "good" js be 2mb, but not 2,1mb for instance?

As for a "distraction free" toggle that would be an option in the menubar not a permanently visible UI element, since that doesn't really qualify for not annoying people who do not care. (and usually this should be something you, per each site, ideally only have to setup once with the vast majority beeing covered by whatever you decide is a good default.)

I think a good default would be blocking everything we consider a tracker, like safari does, and maybe blocking (targeted) advertisement per default. (I.e one that is served by a third party server with javascript additionaly, and not embededd as png in the page)

Note: See TracTickets for help on using tickets.