youtube-stop-autostart

Stop autostart videos on youtube

  1. // ==UserScript==
  2. // @author @leoncastro
  3. // @namespace https://github.com/leoncastro
  4. // @name youtube-stop-autostart
  5. // @version 0.02
  6. // @description Stop autostart videos on youtube
  7. // @icon http://s.ytimg.com/yts/img/favicon_48-vfl1s0rGh.png
  8. // @include /^(https?:)?\/\/(www\.)?youtube\.com\/*.*/
  9. // @compatible firefox+greasemonkey
  10. // @compatible chrome+tampermonkey
  11. // @grant none
  12. // @run-at document-end
  13. // ==/UserScript==
  14. // v0.01: document.querySelector('#movie_player').cueVideoByPlayerVars(document.querySelector('#movie_player').getVideoData());
  15. // v0.02:
  16. function ytStopVideo(i){i&&(i=document.querySelector(i))&&i.cueVideoByPlayerVars(i.getVideoData())}
  17. if(/^\/(channel|user)\//i.exec(location.pathname)) // '/channel/CHANNEL_ID' or '/user/UserName'
  18. (new MutationObserver(function(m){ytStopVideo('#c4-player')})).observe(document.querySelector('#upsell-video'),{childList:true});
  19. else // '/watch?v=VIDEO_ID'
  20. ytStopVideo('#movie_player');

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址