News for hackers. Stuff that matters.
Re:Some notes on Firefox's media autoplay settings in practi... by butz on Saturday March 30, 2024 @06:27AM (#39873505)
There need to be more strict settings for autoplay, not only for video and audio, but for huge GIF files too. I'd put them under "energy saving" settings, as reduced network activity would benefit for server too, not to mention all CPU cycles saved for not decoding all media on client side. Autoplay activation triggers should be reviewed as well, as some sites will happily start autoplaying all media after scrolling down using main scrollbar. That's probably only me, but I still consider scrollbar a part of browsers chrome, not part of website. So interacting with it should not give any hints to website, at least where media autoplay is concerned.
Re:Some notes on Firefox's media autoplay settings in practi... by rightbyte on Saturday March 30, 2024 @08:04AM (#39874054)
I don't need any strict settings for autoplay. I don't need autoplay.

Maybe there could be like a 2Mb cap on each page load that you'd manually had to extend the quota on. Most sites that need more are accidental visits anyway. That should work even if the site is user hostile.

Re:Some notes on Firefox's media autoplay settings in practi... by dylan604 on Saturday March 30, 2024 @10:31AM (#39875247)
How would that cap work? Would the browser be expected to calculate the size of all elements by querying them all before loading anything? Would the browser just start downloading content counting bits as it goes, and then just stop when it reached 2Mb? What if the page was laid out in such a way that the JS includes were >2Mb?

Just a second of though about the comment made would show so many issues with the idea, that maybe the idea isn't really a good one. At the least it would provide pause that maybe some sort of refinement is required to be taken seriously by anyone else.

Re:Some notes on Firefox's media autoplay settings in practi... by edflsafoiewq on Saturday March 30, 2024 @11:40AM (#39875894)
What would happen if you yanked the ethernet cord after 2Mb transferred? Same thing. You can't precalculate the size since resources are added dynamically (and you can't trust HEAD anyway).
Re:Some notes on Firefox's media autoplay settings in practi... by palmfacehn on Saturday March 30, 2024 @11:01AM (#39875504)
Re:Some notes on Firefox's media autoplay settings in practi... by qwery on Saturday March 30, 2024 @03:27PM (#39877832)
If you want all the javascript, don't count the javascript against the quota. If you don't want videos that you're never going to play deliberately, set the video quota to zero.
Re:Some notes on Firefox's media autoplay settings in practi... by skydhash on Saturday March 30, 2024 @03:32PM (#39877869)
it's rare for the html file and the associated css is bigger than 2MB (much epub books is lighter than that if you reduce image size). The culprit are often media (fonts included), JS files, and files loaded dynamically. I'd say get the HTML and CSS files first, then JS and everything else and stops after the 2MB threshold. A lot of currently running JS code are unnecessary and I say this as a React developer.
Re:Some notes on Firefox's media autoplay settings in practi... by dylan604 on Saturday March 30, 2024 @03:55PM (#39878056)
so many websites don't actually have full HTML. Instead, its just JS that dynamically create elements after fully being downloaded. Not acknowledging this just shows how much of a not good/realistic/practical idea this is. Pie in the sky idealistic concepts are fun sitting in a pub having a few pints or while sitting in the circle, but they are not productive suggestions in making things better.
Re:Some notes on Firefox's media autoplay settings in practi... by skydhash on Saturday March 30, 2024 @06:24PM (#39879266)
Making things better is forcing website owners to go back to server-side rendered applications. I just blocked the JS files on my self-hosted instance of Gitea to load, and the resulting total size is close to 900kb, with my profile picture file at 250kb. It is still usable. With JS files, the whole thing is 2.2mb and took two seconds to render (0.7 seconds for file transfers). Caching was disabled. Most websites shouldn't be SPA. And the actual instantaneous navigation argument is often negated by slow data loading. Instead of the browser showing a loading bar, it's the application doing it.

As you can't control other people's choices, you can only control your environment. Which often means Firefox+Ublock/NoScript. I use Safari, but only visit a handful of these kinds of sites and never for long, often immediately closing tabs that show popups and annoying animations. And I have a pihole on my network.

Re:Some notes on Firefox's media autoplay settings in practi... by dylan604 on Saturday March 30, 2024 @07:28PM (#39879665)
Your declaration of websites not needing to be SPA may or may not be accurate. However, there are so many sites that are made from template providers like Wix/SquareSpace/Shopify/whatEvs that allow people with 0 knowledge of how a website is made. These sites will not render without JS.

These are companies that have allowed so many people to have a website that essentially is a SPA because that's an easy way for them to deploy template based sites. These are much easier to maintain than WordPress sites. Yes, I agree that most of these sites are simply static sites, and I think it would be amazing if these template JS library sites would allow you to render it flat static site once you hit publish or the equivalent. However, they would probably balk at the notion of not protecting their IP with obfuscated code and delivering readable HTML/CSS. I seriously doubt it takes 2MB of JS to operate these sites, and I'm guessing probably 90% of that code isn't used but is just bundled so the same thing is used everywhere.

However, to prove your point, there are many occasions where I've taken as a weekend project to find a template from Wix or similar that I like, and then recreate it in HTML/CSS by hand. It very much is a smaller site. But that's not something anyone here is disputing. The dispute is that you're wanting a fantasy world, and that's not the one we live in.

Re:Some notes on Firefox's media autoplay settings in practi... by skydhash on Saturday March 30, 2024 @08:03PM (#39879914)
Just as the article [0] have described it, the web is already split. You can either choose Times Square or the scenic retreat, the consumer magazine or a nice book. I choose to minimize my time on the "normal" web which breaks if I block ads and tracking scripts. And instead spend it here and in my RSS reader.

[0]: https://ploum.net/2023-08-01-splitting-the-web.html

Re:Some notes on Firefox's media autoplay settings in practi... by rightbyte on Saturday March 30, 2024 @03:42PM (#39877932)
I was thinking like, don't make any more request if the limit is transgressed. So the limit could be surpassed by the last request.

Otherwise I guess the limit could be in the tcp layer too.

And the limit would not care about breaking sites. So I guess it would only be aimed at technical users on mobile where bytes count. Unless it is easy to "continue" without serverside state breaking.

Re:Some notes on Firefox's media autoplay settings in practi... by qwery on Saturday March 30, 2024 @03:30PM (#39877858)
UBlock Origin has an option to block large media elements[0] by default / per-site. You can configure the threshold.

[0] https://github.com/gorhill/uBlock/wiki/Per-site-switches#no-...

Re:Some notes on Firefox's media autoplay settings in practi... by rightbyte on Saturday March 30, 2024 @03:47PM (#39877980)
Hmm... thanks for the tip.

I actually think I'll see if it is possible to do this with extensions api.

Re:Some notes on Firefox's media autoplay settings in practi... by musicale on Saturday March 30, 2024 @05:04PM (#39878641)
> I don't need autoplay.

I don't need it. I don't want it. I try to disable it. But the setting either is ignored or simply doesn't work.

When and why did browsers give up on reliable autoplay blocking?

Re:Some notes on Firefox's media autoplay settings in practi... by rightbyte on Monday April 01, 2024 @10:19AM (#39894417)
Most autoplays seems user hostile. And it is futile to execute hostile code and try to make it behave. (Kudos for UBlock Origin etc for trying anyway, though!)

But at least there should be an easy way to make a website not have access to your speakers unless you opt in. 99% of the times, it's ads anyway, so the default should be to block sound. But that does not solve the bandwidth waste problem.

Fundamentally, the problem is Javascript. It makes it really hard for the user to be in control.

Re:Some notes on Firefox's media autoplay settings in practi... by Semaphor on Saturday March 30, 2024 @06:35AM (#39873537)
I wish gif’s adhered to prefers-reduced-motion and preferably only played on interaction. I use Toggle Animated Gifs [0], but it’s a global on/off switch, requires a reload, and doesn’t show a hint that something could be animated.

[0]: https://github.com/M-Reimer/toggleanigif

Re:Some notes on Firefox's media autoplay settings in practi... by mikae1 on Saturday March 30, 2024 @07:05AM (#39873702)
image.animation_mode = none im about:config.
Re:Some notes on Firefox's media autoplay settings in practi... by Semaphor on Saturday March 30, 2024 @07:12AM (#39873745)
Doesn’t that completely disable them, only without the convenience of a toggle?
Re:Some notes on Firefox's media autoplay settings in practi... by paulryanrogers on Saturday March 30, 2024 @08:27PM (#39880105)
Yes.

You can also use 'once' to have them stop after first playthrough.

Re:Some notes on Firefox's media autoplay settings in practi... by Semaphor on Sunday March 31, 2024 @06:50AM (#39883109)
Yeah, but the extension is already offering that with more convenience. What I’m looking for is a better solution, as described in my post.
Re:Some notes on Firefox's media autoplay settings in practi... by antegamisou on Saturday March 30, 2024 @07:50AM (#39873959)
The worst thing is those websites that have some type of 2160p type of video autoplay as a background image, making it unbrowsable on cheaper hardware devices.

But this is more a rant for modern webdev practices I'm not sure much can be done to circumvent it from a browser perspective.

Re:Some notes on Firefox's media autoplay settings in practi... by nine_k on Saturday March 30, 2024 @09:36AM (#39874738)
Back when Opera was a worthy browser, around 2000, it had various bandwidth-saving and CPU-saving controls. In particular, it had buttons to prevent loading of large images, and IIRC for gif autoplay.
Re:Some notes on Firefox's media autoplay settings in practi... by gevz on Saturday March 30, 2024 @10:07AM (#39875037)
Vivaldi is worthy successor and have those toggles built-in.
Re:Some notes on Firefox's media autoplay settings in practi... by rjzzleep on Saturday March 30, 2024 @02:38PM (#39877449)
and with such a slow GUI that you couldn't run in on those low performance devices even with those toggles enabled...
Re:Some notes on Firefox's media autoplay settings in practi... by EasyMark on Saturday March 30, 2024 @10:27PM (#39880797)
what? I use vivaldi on a nine year old desktop and its fine.
Re:Some notes on Firefox's media autoplay settings in practi... by palmfacehn on Saturday March 30, 2024 @10:59AM (#39875490)
Send a HEAD request. If the file size is over the threshold, don't load it without user consent.
Re:Some notes on Firefox's media autoplay settings in practi... by cqqxo4zV46cp on Saturday March 30, 2024 @01:21PM (#39876706)
A perfect idea for the people who almost certainly aren’t using “cheaper hardware devices”.
Re:Some notes on Firefox's media autoplay settings in practi... by mariusor on Saturday March 30, 2024 @05:00PM (#39878614)
I wonder why nobody introduced a "Accept-Max-Size" request header?

Chrome is toying with custom accept header[1] types but they're used by servers to request information from clients, which is completely missing the point in my opinion.

[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_ne...

Re:Some notes on Firefox's media autoplay settings in practi... by contravariant on Saturday March 30, 2024 @09:58PM (#39880645)
Pretty sure this is part of uBlocks standard features.

Honestly it's getting a bit too noticeable how a full-featured adblocker is converging on just a way to let the user take back control over the user agent.

Re:Some notes on Firefox's media autoplay settings in practi... by thejohnconway on Saturday March 30, 2024 @09:12AM (#39874544)
People will start animating with JavaScript through canvas or other hacks (like rapidly changing the img src to play frames manually).

Not sure if this is winnable with the all-powerful JavaScript sitting there nearly always available.

Re:Some notes on Firefox's media autoplay settings in practi... by ryandrake on Saturday March 30, 2024 @10:14AM (#39875104)
You are right, but it’s at least one step in the right direction. Browsers are so timid when it comes to giving users control, I’ll take anything.

I don’t get this web developer attitude of just ignoring the user’s preference and working around it. The user should be in control of what the browser is doing, not the web developer. I really want to love JavaScript but it’s power to override user preferences is inexcusable.

Re:Some notes on Firefox's media autoplay settings in practi... by skydhash on Saturday March 30, 2024 @03:38PM (#39877908)
I like Safari, but it does not want me to enable JavaScript per site.
Re:Some notes on Firefox's media autoplay settings in practi... by ryandrake on Saturday March 30, 2024 @03:45PM (#39877962)
Safari desktop has recently made toggling JavaScript a huge pain in the ass. Before, it was just in the menu: Develop -> Disable JavaScript. With the most recent Safari, you have to go into Settings, then Security tab, then uncheck Enable JavaScript.

Horrible and totally unnecessary UI change, Apple. You could have easily kept the menu item. This is a frequently used action, it shouldn't be buried in Settings!!

Re:Some notes on Firefox's media autoplay settings in practi... by RobotToaster on Saturday March 30, 2024 @09:44AM (#39874813)
Not wrong.

Most browsers included a popup blocker because everyone agreed popups are annoying, now nearly every website has 3 different JS popups.

Re:Some notes on Firefox's media autoplay settings in practi... by dylan604 on Saturday March 30, 2024 @10:33AM (#39875264)
honestly, I still feel like that is a win for users. pop-ups that are modals on a site is not anywhere close to open application windows, especially the pop-unders. to me, opening another application window on my system is much more abhorrent than a site deciding it wants my attention somewhere else on its site.
Re:Some notes on Firefox's media autoplay settings in practi... by kevin_thibedeau on Saturday March 30, 2024 @09:17AM (#39874574)
You win by running NoScript and blacklisting the modern web BS.
Re:Some notes on Firefox's media autoplay settings in practi... by maxcoder4 on Saturday March 30, 2024 @09:16AM (#39874567)
Ublock origin has this feature where it blocks large media files automatically (you have to click to load them). I use it for a long time and never had problems because of it.
Re:Some notes on Firefox's media autoplay settings in practi... by thisislife2 on Saturday March 30, 2024 @09:47AM (#39874839)
Which settings are you specifically referring to in uBlock O? I didn't find any 'click-to-load' option for 'Block media elements larger than' option?
Re:Some notes on Firefox's media autoplay settings in practi... by ZephyrOhm on Saturday March 30, 2024 @12:45PM (#39876401)
Check out yokoffing's uBO filter lists. Specifically #2 "click2load" which does exactly what you're seeking. Making auto play content click to load.

https://github.com/yokoffing/filterlists?tab=readme-ov-file

Re:Some notes on Firefox's media autoplay settings in practi... by lesona on Saturday March 30, 2024 @10:15AM (#39875108)
Check out uBlock Origin's per site switches - subheading "No large media elements" [1]

[1]: https://github.com/gorhill/uBlock/wiki/Per-site-switches#no-...

Re:Some notes on Firefox's media autoplay settings in practi... by schiffern on Saturday March 30, 2024 @11:20AM (#39875669)
Then they said "click to load" they meant "click [the toggle button in the uBlock Origin panel] to load," not "click [the media element] to load."
Re:Some notes on Firefox's media autoplay settings in practi... by forgotmyinfo on Saturday March 30, 2024 @02:49PM (#39877530)
Not sure what I'm doing, but whatever I'm using with uBlock Origin lets me click the media element to load it.
Re:Some notes on Firefox's media autoplay settings in practi... by dredmorbius on Saturday March 30, 2024 @02:54PM (#39877565)
This is a further issue for those using e-ink devices (tablets, e-book readers, monitors), where rapid animation at higher quality settings is exceedingly disruptive --- stuttering, screen-flashing, and the like. (It is possible to display animations, if desired, at reasonable refresh rates using lower-quality display settings, e-ink offers a trade-off between text quality (resolution, ghosting) and refresh rates. But as if there needed to be additional arguments to put a hard stop on highly-distracting design elements, this really stands out.)

I've also found it ... interesting ... to note that a single Web page often has the memory footprint of an entire book (a few MB for just plain text, though that can balloon upwards with complex typesetting and graphics), and that even a browser optimised for e-ink (Einkbro) has roughly 10x the power consumption of the stock ebook reader (Neoreader) on my Onyx BOOX tablet (labeled as an e-book reader, but in fact an e-ink based Android tablet).

I can read books for days on a single battery charge. I can browse the Web for ... a few hours.

Re:Some notes on Firefox's media autoplay settings in practi... by skydhash on Saturday March 30, 2024 @03:23PM (#39877786)
While the web allows for a lot of creative expressions, I think we should have companion protocols for alternate consumptions methods, something like Gemini for every page. An e-ink reader is good for focused reading, but bad for interactive or animated content. Just like gwern.net allows to add `.page` to every link and get the raw source, you could add `.gemini` to wikipedia pages and get a much simpler document that you can read on e-ink reader or a cli device (should be good for accessibility too).
Re:Some notes on Firefox's media autoplay settings in practi... by csande17 on Saturday March 30, 2024 @03:55PM (#39878052)
Re:Some notes on Firefox's media autoplay settings in practi... by dredmorbius on Saturday March 30, 2024 @07:10PM (#39879558)
Wikisource as well, where one can choose HTML, ePub, or PDF on most documents.

Other sites permit one to append ".json" for a raw JSON feed.

Re:Some notes on Firefox's media autoplay settings in practi... by dredmorbius on Sunday March 31, 2024 @10:41AM (#39884708)
Update: as I noted in another comment, both Wikipedia and Wikisource of course run MediaWiki as their wiki engine. Not sure if the HTML/PDF capability is baked in there or not.
Re:Some notes on Firefox's media autoplay settings in practi... by dredmorbius on Saturday March 30, 2024 @09:29PM (#39880494)
I'd really like to see something like this and have thought that an online publishing engine which would produce HTML, ePub, PDF, or other output formats or endpoints on demand might be useful.

There are sites already which provide some form of this, notably sites using MediaWiki (which notably powers Wikipedia and Wikisource) offer multiple download options, though I don't think it's quite as flexible as I'd prefer.

Client support would be the other factor, with current Web browsers not being particularly multi-format. Though to be fair, Firefox, Safari, and Chrome all now natively support PDF documents.

I suspect that a render-to-ePub would be a much better alternative to standard HTML for mobile devices. ePub is inherently fluid, and tends to offer a subset of full HTML capabilities. (ePub is of course an archive of HTML, stylesheet, and other elements, though usually it's more strongly textually oriented than the modern Web is.)

For sufficiently large tablets, PDFs are actually a quite good document format.

Re:Some notes on Firefox's media autoplay settings in practi... by musicale on Saturday March 30, 2024 @05:00PM (#39878616)
You had one job, browser "never auto-play" setting....