Closed KonoromiHimaries closed 6 years ago
I definitely saw that, any idea on how to implement it?
Chrome already has Autoplay Policy via chrome://flags
"Blocking auto-play in Chrome is not effective enough for me."
Sorry for taking up lots of space but... I made a quick script for stopping autoplaying videos but it can probably be enhanced and cleaned up allot. Also this is a userscript made in and for Tampermonkey not sure how well it will work else where and or what changes would need to be made.
Also I know the code is kinda bad no need to get worked up about it. <3
It's long, so I folded it, click the triangle to expand it. Since it's grant none, it will "just works", however, using the right tool for the job is probably better. Since it is a Tampermonkey script, why not use Tampermonkey?
@jspenguin2017 Thanks, I'm not very familiar with Markup, else I would have done that myself. Updated the code a bit.
Also I know it "just works" with Tampermonkey however this issue is about having an injectible script that will block autoplaying videos (at least that's how I interpreted the OP) on target sites and I thought that my userscript would help either you or any one else who's interested in contributing get started on making something. ^^;
I mean all script snippets are like "grant none", which means those Userscripts would work with Nano, just I think it makes more sense to use Tampermonkey or Violentmonkey for injecting Userscripts.
Ah okay, at least I contributed something.
Off Topic: Do you prefer Violentmonkey over Tampermonkey? I've been using Tamper forever but heard about Violent only recently.
I prefer wrapping my Userscripts in an extension. Both TM and VM have some race condition, I think TM has some hacks that make its scripts to inject faster, but real extensions are guaranteed to run on the real document-start
. Doing so also makes them really lightweight. And I have access to powerful extension APIs such as management.
Why not try both out and see which one you like?
Your method actually sounds interesting but it sounds painful to have to rezip every time. Do you have a Discord server/account so that we can talk without hijacking this issue?
I don't have Discord. I haven't changed my extension in the past 3 months, if you find yourself changing it often then no, that's probably not going to work for you. Unless you don't mind putting all the code public, there isn't a cheap and easy way to automate the process.
@LuaTenshi Actually, you may not need to re-zip it every time, for one, you can have a build script to zip and push that automatically to Web Store, otherwise, if you are using Chromium, you can load developer mode extensions and it will stay. For Chrome on Windows and macOS, Google put in some extra "security" and it's a pain to use unpacked extensions.
Now back on topic: I don't see a reasonable way to block auto-play with script snippet. Google is putting that in Chrome soon, so I guess I'll flag this as wontfix.
Nano is available on Firefox too. Closing.
@LuaTenshi thats a cool userscript. you should put it on greasyfork
@elypter If I knew for sure that it would work on even the toughest of sites I'd put it on greasyfork but sadly I'm not sure on how to get it working on places like Twitch etc...
I know it's excluded but I removed it from the excludes to try things.
UPDATE: Do not use this script, it makes your browser freeze and your tab die on some sites. Not sure why. Also sometimes it just doesn't even work. ;w;
its not perfect but i think it would still help people. for the 2 sites i was opening since installing it worked in both cases. those were tagesschau.de and hooktube.com (i dont mind autoplay on those sites but it worked as intended). if yu dont want to release it on greasyfork yet you can just put it on github too. i also have 2 userscripts on github that do not work perfectly. they are also easy to install if you have INSTALL USER SCRIPT
So just to double-check, the best way to disable autoplay is using script or go into browser experimental features? gonna check out the script b/c i know the experimental feature is junk and doesn't work that well.. just test it out on cnet for example.
AutoPlay Disabled for HTML5 Videos + chrome autoplay policy
https://greasyfork.org/pl/scripts/30974-autoplay-disabled-for-html5-videos-pause-on-switch-tab
example.
https://eurosport.interia.pl/raporty/raport-pjongczang-2018/wideo/video,vId,2476144
It uses MutationObserver
, where I question its reliability.
@hawkeye116477 That code quality is absolutely unacceptable.
img
![img](https://user-images.githubusercontent.com/5884000/33995184-78cbb734-e0dd-11e7-86d9-c6b32c945818.png)