Easy change speed Youtube

try to take over the world!

目前为 2018-12-13 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Easy change speed Youtube
  3. // @namespace http://tampermonkey.net/
  4. // @icon https://raw.github.com/reek/anti-adblock-killer/master/anti-adblock-killer-icon.png
  5. // @version 0.1
  6. // @description try to take over the world!
  7. // @author HuuKhanh
  8. // @match https://www.youtube.com/
  9. // @grant none
  10. // @include http://*/*
  11. // @include https://*/*
  12. // ==/UserScript==
  13.  
  14. /*
  15. - Enter rate to search bar then press '`' to change raterate
  16. */
  17. (function() {
  18. 'use strict';
  19.  
  20. document.getElementsByName('search_query')[0].addEventListener("keypress", function(event) {
  21. var x = event.which || event.keyCode;
  22. if(x == 96) {
  23. var rate = document.getElementsByName('search_query')[0].value;
  24. document.getElementsByTagName('video')[0].playbackRate = rate;
  25. console.log('changed');
  26. }
  27. }) ;
  28. })();