Auto Click Chatbox

This script automatically clicks the "Message Input" button on the sidebar on kick.com when the stream is live.

目前為 2024-01-22 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Auto Click Chatbox
  3. // @namespace https://greasyfork.org/en/users/1200587-trilla-g
  4. // @match *://*.kick.com/*
  5. // @grant none
  6. // @version 5.0
  7. // @license MIT
  8. // @author Trilla_G
  9. // @description This script automatically clicks the "Message Input" button on the sidebar on kick.com when the stream is live.
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14.  
  15. function isLive() {
  16. let liveDisplay = document.querySelector(".vjs-live-control");
  17. return liveDisplay && !liveDisplay.classList.contains('vjs-hidden');
  18. }
  19.  
  20. function clickMessageInput() {
  21. let messageInputButton = document.querySelector('#message-input');
  22. if (messageInputButton) {
  23. messageInputButton.click();
  24. console.log('Clicked Message Input button.');
  25. }
  26. }
  27.  
  28. // Function to check URL changes and trigger action
  29. const checkAndTrigger = () => {
  30. if (isLive()) {
  31. clickMessageInput();
  32. }
  33. };
  34.  
  35. // Observe URL changes using setInterval
  36. setInterval(checkAndTrigger, 1600); // Check every 1 second (adjust as needed)
  37. })();
  38.