TeleParty Addon

Nuke the TeleParty chat and all the other TeleParty crap, all while keeping TeleParty enabled and working :)

  1. // ==UserScript==
  2. // @name TeleParty Addon
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @license MIT
  6. // @description Nuke the TeleParty chat and all the other TeleParty crap, all while keeping TeleParty enabled and working :)
  7. // @author CandiceJoy
  8. // @match http*://hulu.com/*
  9. // @match http*://*.netflix.com/*
  10. // @match http*://*.disneyplus.com/*
  11. // @match http*://play.hbomax.com/*
  12. // @match http*://*.amazon.com/*/video/*
  13. // @icon https://www.google.com/s2/favicons?sz=64&domain=teleparty.com
  14. // @require https://code.jquery.com/jquery-3.6.0.min.js
  15. // @grant none
  16. // ==/UserScript==
  17.  
  18. (function() {
  19. 'use strict';
  20. const header = "[Candi Teleparty]";
  21.  
  22. function log(msg,obj=null)
  23. {
  24. console.log( header + " " + msg );
  25. }
  26.  
  27. let tpActive = false;
  28. let findPlayer;
  29.  
  30. if( window.location.href.match( /netflix\.com/ig ) )
  31. {
  32. log("Netflix detected");
  33. findPlayer = function(){return document.querySelector(".watch-video--player-view");};
  34. }
  35. else if( window.location.href.match( /hulu\.com/ig ) )
  36. {
  37. log("Hulu detected");
  38. findPlayer = function(){return document.querySelector("#dash-player-container");};
  39. }
  40. else if( window.location.href.match( /disneyplus\.com/ig ) )
  41. {
  42. log("Disney+ detected");
  43. findPlayer = function(){return document.querySelector("#hudson-wrapper");};
  44. }
  45. else if( window.location.href.match( /hbomax\.com/ig ) )
  46. {
  47. log("HBO Max detected");
  48. findPlayer = function(){return null;};
  49. }
  50. else if( window.location.href.match( /amazon\.com/ig ) )
  51. {
  52. log("Amazon Prime detected");
  53. findPlayer = function(){return document.querySelector(".webPlayerSDKContainer");};
  54. }
  55. else
  56. {
  57. log("Streaming service not supported");
  58. }
  59.  
  60. function callback(mutations,observer)
  61. {
  62. if( window.location.href.match( /hbomax/ig ) )
  63. {
  64. const area = document.querySelector("div.default");
  65.  
  66. if( area )
  67. {
  68. const size = area.style.width;
  69. const player = document.querySelector(".tp-video");
  70.  
  71. if( player )
  72. {
  73. log("Resizing video");
  74. player.style.width = size;
  75. }
  76. }
  77. }
  78. else
  79. {
  80. const player = findPlayer();
  81.  
  82. if( player && player.classList.contains("with-chat") )
  83. {
  84. log("Resizing video");
  85. player.classList.remove("with-chat");
  86. }
  87. }
  88.  
  89. if( !tpActive )
  90. {
  91. for(const mutation of mutations)
  92. {
  93. const target = mutation.target;
  94. const classes = mutation.target.classList;
  95.  
  96. if( classes.contains("PlayerMetadata__subTitle") || classes.contains("ControlsContainer__transition") )
  97. {
  98. continue;
  99. }
  100.  
  101. //console.log("Mutated ",target);
  102.  
  103. if( target.querySelector("#tpIconContainer") || target.querySelector("#chat-wrapper") )
  104. {
  105. log("Detected Teleparty");
  106. tpActive = true;
  107. break;
  108. }
  109. }
  110. }
  111.  
  112. if( !tpActive )
  113. {
  114. return;
  115. }
  116.  
  117. const popup = document.querySelector("#tpIconContainer");
  118.  
  119. if( popup )
  120. {
  121. log("Removing popup");
  122. popup.remove();
  123. }
  124.  
  125. const chat = document.querySelector("#chat-wrapper");
  126.  
  127. if( chat )
  128. {
  129. log("Removing chat");
  130. chat.remove();
  131. }
  132.  
  133. if( !popup && !chat )
  134. {
  135. //observer.disconnect();
  136. log("Teleparty no longer detected");
  137. tpActive = false;
  138. }
  139. }
  140.  
  141. log("Enabling observer");
  142. const targetNode = document.getElementsByTagName("body")[0];
  143. const config = { attributes: true, childList: true, subtree: true };
  144. const observer = new MutationObserver(callback);
  145. observer.observe(targetNode, config);
  146. //observer.disconnect();
  147. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址