Zoom automatically raise hand

By detecting how many others are raising their hand, if exceed the threshold you set, then the program will automatically raise your hands.

  1. // ==UserScript==
  2. // @name Zoom automatically raise hand
  3. // @name:zh-TW Zoom自動舉手
  4. // @namespace http://tampermonkey.net/
  5. // @version 0.4
  6. // @description By detecting how many others are raising their hand, if exceed the threshold you set, then the program will automatically raise your hands.
  7. // @description:zh-TW 檢測有多少人舉手,如果超過閾值,程序將自動舉手
  8. // @author You
  9. // @match *://zoom.us/wc/*
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. var bar = document.getElementsByClassName("footer__inner")[0];
  17. var tray = document.createElement("div");
  18. tray.innerHTML = '<span>Raise hand if </span> <input id="hands" style="width: 30px; background-color: black;border: solid 1px white;"></input> hands are raising <button id="handBtn" style="background-color: black; border: solid 1px white;">Set</button> <button id="stopBtn" style="background-color: black; border: solid 1px white;">Stop</button><br><span id="pluginText">The plugin will only work when opening the participant list.</span>';
  19. tray.setAttribute ('id', 'mask');
  20. tray.style.position = "absolute";
  21. tray.style.color = "white";
  22. tray.style.backgroundColor = "rgba(0,0,0,0)";
  23. tray.style.left = "250px";
  24. tray.style.top = "5px";
  25. tray.style.zIndex = "999999";
  26. bar.insertBefore(tray, bar.childNodes[1]);
  27. var interval2;
  28. var hands;
  29. var text23 = document.getElementById("pluginText");
  30.  
  31. function startHang(){
  32. clearInterval("interval2");
  33. interval2 = setInterval(function(){
  34. var array = document.getElementsByClassName("participants-icon__participants-raisehand");
  35. if(typeof(document.getElementsByClassName("nonverbal-icon raisehand-icon")[0]) == "undefined"){
  36. text23.innerHTML = "Please open the participant list in order to run the code.";
  37. text23.style.color = "red";
  38. }else{
  39. text23.innerHTML = "Plugin is running.";
  40. text23.style.color = "white";
  41. }
  42. var handStatus = document.getElementsByClassName("nonverbal-icon raisehand-icon")[0].className;
  43.  
  44. if((hands <= array.length && handStatus.indexOf("selected") == -1)||(hands > array.length && handStatus.indexOf("selected") != -1)){
  45. document.getElementsByClassName("button-without-style")[0].click();
  46. }
  47. }, 2000);
  48. }
  49.  
  50. var handBtn = document.getElementById("handBtn");
  51. handBtn.onclick = function(){
  52. hands = Number(document.getElementById("hands").value);
  53. startHang();
  54. if(typeof(document.getElementsByClassName("nonverbal-icon raisehand-icon")[0]) == "undefined"){
  55. text23.innerHTML = "Please open the participant list in order to run the code.";
  56. text23.style.color = "red";
  57. }else{
  58. text23.innerHTML = "Plugin is running.";
  59. text23.style.color = "white";
  60. }
  61. }
  62.  
  63. var stopBtn = document.getElementById("stopBtn");
  64. stopBtn.onclick = function(){
  65. clearInterval(interval2);
  66. text23.innerHTML = "Plugin is stoped.";
  67. }
  68.  
  69. // Your code here...
  70. })();