gorhill / uBlock

uBlock Origin - An efficient blocker for Chromium and Firefox. Fast and lean.
GNU General Public License v3.0
47.82k stars 3.17k forks source link

Request: Block Video and Audio tags (placeholder "click to start") #2134

Closed Nojevah closed 7 years ago

Nojevah commented 8 years ago

"Long live HTML5 Video and Audio players. Flash Sux !" Yet we now have the same problem as Flash: Automatic download (bandwidth waste), automatic sound (totally stupid on a lot of situation), automatic video (how to trigger GPU for 0 interest).

Fortunately with Flash, we manage to block it and replace it with a placeholder ! It is now a native setting on every decent browser. But with Chrome, for HTML5 elements, despite several requests in tracker, it is still ignored, and there's no hope for the near future. I don't know about Firefox though. I guess there's a key to block autostart, but I'm not sure it blocks automatic download.

There's an extension for Chrome: Disable HTML5 Autoplay. Unfortunately, it is not reliable: sometimes video are launched anyway. Plus even if videos are blocked, the beginning is still downloaded.

So here is my request: Block HTML Audio and Video Elements (I meant prevent download, I don't care about autoplay) and use a placeholder ala "click to start".

I could understand if you told me it cant' happen cause it would bloat the extension, but like I consider it a big web pollution, I hoped you would be interested...

uBlock-user commented 8 years ago

I don't know about Firefox though. I guess there's a key to block autostart, but I'm not sure it blocks automatic download.

Yes, the setting is titled media.autoplay.enabled which stops the auto-play only, not pre-load, so buffering still happens in FF. Either way, this autoplay and auto pre-load is becoming a nuisance and a major annoyance as websites like comicbook.com,cbr.com, screenrant.com have started abusing HTML5 players and have added both these flags for every video they load on their articles.

An example case - http://comicbook.com/2016/11/13/if-you-love-westworld-youll-love-these-comics/

The video loaded on that article has nothing to do with the article itself as loads a trailer for another movie, however CB intends to monetize by adding auto-play videos on every damn article, soon many others will follow if they can have their way with this thing.

gorhill commented 8 years ago

Best is if that is taken care by browser vendors: https://news.ycombinator.com/item?id=12942465.

Thing is, some players are XMLHttpRequest-based (no <video> or <audio> tags), and I don't know how this can be handled in a generalized way by an extension or even browser (aside disabling javascript).

uBlock-user commented 8 years ago

From my personal experience, Brightcove and Playwire are probably using XML as a tool to bypass any click to play blocks and auto play/load videos immediately as these are the only ones I have seen used by media blogs like CB, CBR and ScreenRant so far. Some news websites like CNN are using some other players who also do the same.

Browser vendors hardly care about this, just look at that WebSocket chromium bug which took more than 4 years for developers to come-up with a patch. If that's how this is going to drag along I might have to take the extreme step of installing uMatrix and blocking all 3rd-party content by default as I'm left with no other option at the moment.

lewisje commented 8 years ago

I don't know how this can be handled in a generalized way by an extension

I tried it in a UserScript, with little success: https://greasyfork.org/en/scripts/8022-disable-audio-video-autoplay

uBlock-user commented 8 years ago

^^ Yes, I tried that script too, doesn't work on Brightcove players who make 4-5 attempts to autoplay.

You can use this url as a test case - http://comicbook.com/2016/11/13/talking-dead-guests-are-david-alpert-ron-funches-and-lou-diamond/

uBlock-user commented 7 years ago

https://bugs.chromium.org/p/chromium/issues/detail?id=672086

Seems like work has begun to stop auto playing videos from cross origin requests made via XHRs

uBlock-user commented 7 years ago

A unified policy has been written - https://bugs.chromium.org/p/chromium/issues/detail?id=715049

uBlock-user commented 7 years ago

Great news for Chromium 61 users! A new flag has appeared in Chromium titled Autoplay-Policy @ chrome://flags/#autoplay-policy

Set it to Document user activation is required