Hide New Twitch Features

Hide Hyperchat button/pins and content warnings and click through content prompts

目前为 2023-06-23 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Hide New Twitch Features
  3. // @namespace lig
  4. // @license WTFPL
  5. // @description Hide Hyperchat button/pins and content warnings and click through content prompts
  6. // @version 1.0.1
  7. // @match https://www.twitch.tv/*
  8. // @run-at document-start
  9. // @grant GM.info
  10. // ==/UserScript==
  11.  
  12. const delay = ms => new Promise(res => setTimeout(res, ms));
  13.  
  14. (async () => {
  15. let style = document.createElement('style');
  16. style.innerHTML = `
  17. /* hide content warnings */
  18. #channel-player-disclosures,
  19. /* hide pinned hyperchats at the top of chat */
  20. .paid-pinned-chat-message-list,
  21. /* hide hyperchat button in the message input box */
  22. div:has(> [aria-label="Hype Chat"]) {
  23. display: none !important;
  24. }
  25. `;
  26.  
  27. while(document.head === null) {
  28. await delay(100);
  29. }
  30. document.head.appendChild(style);
  31. do {
  32. let contentPrompt = document.querySelector('[data-a-target="content-classification-gate-overlay-start-watching-button"]');
  33. if(contentPrompt) contentPrompt.click();
  34. await delay(500);
  35. } while(1);
  36. })();