Click Video To Pause

Userscript that enables pause/play on click for kick.com

当前为 2024-06-01 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Click Video To Pause
  3. // @description Userscript that enables pause/play on click for kick.com
  4. // @version 10.0
  5. // @grant none
  6. // @author Trilla_G
  7. // @match *://kick.com/*
  8. // @namespace https://greasyfork.org/en/users/1200587-trilla-g
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. window.addEventListener('click', (event) => {
  13. if (event.target?.classList.contains('vjs-tech')) {
  14. const video = document.querySelector('.vjs-tech');
  15. if (video.paused) {
  16. document.querySelector('.vjs-big-play-button')?.click();
  17. setTimeout(() => {
  18. const messageInput = document.querySelector('#message-input');
  19. if (messageInput) {
  20. messageInput.focus();
  21. } else {
  22. document.documentElement.focus();
  23. }
  24. }, 300); // Adjust the delay if needed
  25. } else {
  26. video.pause();
  27. }
  28. }
  29. });