Stats for Nerds

try to take over the world!

当前为 2021-03-19 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Stats for Nerds
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author Tony Stark
  7. // @match https://www.youtube.com/watch?v=*
  8. // @icon https://www.google.com/s2/favicons?domain=youtube.com
  9. // @grant none
  10. // ==/UserScript==
  11. (function() {
  12. 'use strict';
  13.  
  14. let player = document.querySelector('#movie_player');
  15. player.dispatchEvent(new CustomEvent('contextmenu'));
  16. player.click();
  17.  
  18. document.addEventListener("keydown", e => {
  19. if (e.keyCode === 83) {
  20. document.querySelector('div.ytp-menuitem:nth-child(7)').click();
  21. }
  22. });
  23.  
  24. document.addEventListener("keydown", e => {
  25. if (e.keyCode === 87) {
  26. document.querySelector('.html5-video-info-panel-close').click();
  27. }
  28. });
  29. // Your code here...
  30. })();