SHARE
TWEET

Untitled

a guest Jul 14th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           Youtube HTML5 stop autoplay
  3. // @namespace      http://smiler.se/
  4. // @description    Prevent HTML5 videos on youtube from autoplaying
  5. // @include        http://youtube.com/watch?*
  6. // @include        http://*.youtube.com/watch?*
  7. // @include        http://youtube.com/watch#*
  8. // @include        http://*.youtube.com/watch#*
  9. // @include        http://*.youtube.com/embed/*
  10. // @include        http://youtube.com/embed/*
  11. // @include        https://youtube.com/watch?*
  12. // @include        https://*.youtube.com/watch?*
  13. // @include        https://youtube.com/watch#*
  14. // @include        https://*.youtube.com/watch#*
  15. // @include        https://*.youtube.com/embed/*
  16. // @include        https://youtube.com/embed/*
  17. // ==/UserScript==
  18.  
  19. function onLoad() {
  20.     setTimeout(function(){
  21.         video = document.getElementsByTagName('video')[0];
  22.         if (video) {
  23.             video.pause();
  24.             video.currentTime = 0;
  25.         }
  26.     }, 300);
  27. }
  28.  
  29. window.addEventListener('load', onLoad, false);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top