Larger Twitch squad player

Removes the title bar in Twitch squad streams to increase the player size

当前为 2022-08-26 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Larger Twitch squad player
  3. // @description Removes the title bar in Twitch squad streams to increase the player size
  4. // @namespace https://github.com/Sv443/larger-twitch-squad-player
  5. // @match *://www.twitch.tv/*/squad
  6. // @grant none
  7. // @license MIT
  8. // @version 1.0
  9. // @author Sv443
  10. // @run-at document-start
  11. // @icon https://www.google.com/s2/favicons?domain=twitch.tv
  12. // ==/UserScript==
  13.  
  14. "use strict";
  15.  
  16. document.addEventListener("DOMContentLoaded", removeBar);
  17.  
  18. let tries = 0;
  19.  
  20. function removeBar()
  21. {
  22. const bar = document.querySelector(".squad-stream-top-bar__container");
  23.  
  24. if(bar)
  25. {
  26. bar.remove();
  27. console.info("Removed title bar.\nUserscript by Sv443.");
  28. }
  29. else if(tries < 20)
  30. {
  31. setTimeout(removeBar, 100);
  32. tries++;
  33. }
  34. else
  35. console.error("Couldn't find title bar to remove.");
  36. }