diff --git a/README.md b/README.md
index d6be7cd..cb2cc83 100644
--- a/README.md
+++ b/README.md
@@ -12,8 +12,10 @@ It also provides a few additional options:
- Hide sidebar suggested videos
- Hide comments
- Hide AI summaries
+- Hide members only videos (paid channel restricted content)
- Always play videos from the start
- Use a black background for the video player (enabled by default)
+- Choose how many videos to show per row on the home page
*These can be accessed via the custom settings menu. You will find this down the bottom right of Youtube when installed.*
@@ -84,7 +86,7 @@ This plugins helps to keep this important resource free and available to everyon
## Make a Donation
**This adblocker is 100% free to use and always will be.
-It has helped over 170,000 people remove the unbearable ads from Youtube.**
+It has helped over 175,000 people remove the unbearable ads from Youtube.**
This project has been made entirely by myself, as just one developer. Countless hours and late nights have gone into making this and I continue to work on updating and maintaining the project regularly. I remain dedicated to ensuring this solution continues to work for everyone (despite Youtube's best efforts to stop adblockers).
diff --git a/goodtube.js b/goodtube.js
index 049f100..2ef0c2f 100644
--- a/goodtube.js
+++ b/goodtube.js
@@ -261,6 +261,13 @@
goodTube_hideAiSummaries = 'false';
}
+ // Are members only videos enabled?
+ let goodTube_hideMembersOnlyVideos = goodTube_helper_getCookie('goodTube_hideMembersOnlyVideos');
+ if (!goodTube_hideMembersOnlyVideos) {
+ goodTube_helper_setCookie('goodTube_hideMembersOnlyVideos', 'false');
+ goodTube_hideMembersOnlyVideos = 'false';
+ }
+
// Always play videos from the start?
let goodTube_alwaysStart = goodTube_helper_getCookie('goodTube_alwaysStart');
if (!goodTube_alwaysStart) {
@@ -275,6 +282,13 @@
goodTube_blackBackground = 'true';
}
+ // Videos per row on the home page
+ let goodTube_videosPerRow = goodTube_helper_getCookie('goodTube_videosPerRow');
+ if (!goodTube_videosPerRow) {
+ goodTube_helper_setCookie('goodTube_videosPerRow', 'true');
+ goodTube_videosPerRow = 'default';
+ }
+
// Is autoplay turned on?
let goodTube_autoplay = goodTube_helper_getCookie('goodTube_autoplay');
if (!goodTube_autoplay) {
@@ -372,7 +386,7 @@
// Hide the main Youtube player
cssOutput += `
- body:not(.goodTube_fallback) #player:not(.ytd-shorts),
+ body:not(.goodTube_fallback) #player:not(.ytd-shorts):not(.ytd-channel-video-player-renderer),
body:not(.goodTube_fallback) #player-full-bleed-container {
visibility: hidden !important;
}
@@ -445,12 +459,67 @@
console.log('[GoodTube] AI summaries removed');
}
+ // Hide members only videos if they're not enabled
+ if (goodTube_hideMembersOnlyVideos === 'true') {
+ // Debug message
+ console.log('[GoodTube] Members only videos removed');
+ }
+
+ // Videos per row on the home page
+ if (goodTube_videosPerRow !== 'default') {
+ // Set videos per row on the home page
+ goodTube_youtube_setVideosPerRow(goodTube_videosPerRow);
+
+ // Debug message
+ console.log('[GoodTube] Videos per row on the home page set to ' + goodTube_videosPerRow);
+ }
+
// Add the styles to the page
let style = document.createElement('style');
style.textContent = cssOutput;
document.head.appendChild(style);
}
+ // Set videos per row on the home page
+ let goodTube_youtube_setVideosPerRow_timeout = setTimeout(() => {}, 0);
+ function goodTube_youtube_setVideosPerRow(videosPerRow) {
+ // Make sure we're on the home page
+ let currentUrl = window.location.href;
+ currentUrl = currentUrl.replace('https://', '').replace('http://', '');
+ let bits = currentUrl.split('/');
+ if (bits.length <= 2) {
+ // Target the aspect ratio element with the CSS variables
+ let variableElement = document.querySelector('ytd-rich-grid-renderer #contents');
+
+ // Make sure we found the variable element, if not retry
+ if (!variableElement) {
+ clearTimeout(goodTube_youtube_setVideosPerRow_timeout);
+ goodTube_youtube_setVideosPerRow_timeout = setTimeout(() => { goodTube_youtube_setVideosPerRow(videosPerRow); }, 100);
+ return;
+ }
+
+ // Set the videos per row
+ variableElement.style.setProperty("--ytd-rich-grid-items-per-row", videosPerRow);
+ variableElement.style.setProperty("--ytd-rich-grid-posts-per-row", videosPerRow);
+ variableElement.style.setProperty("--ytd-rich-grid-slim-items-per-row", videosPerRow);
+ variableElement.style.setProperty("--ytd-rich-grid-game-cards-per-row", videosPerRow);
+ variableElement.style.setProperty("--ytd-rich-grid-mini-game-cards-per-row", videosPerRow);
+ }
+ }
+
+ // Hide members only videos
+ function goodTube_youtube_hideMembersOnlyVideos() {
+ let videos = document.querySelectorAll('ytd-rich-item-renderer:not(.goodTube_checked)');
+ videos.forEach((element) => {
+ if (element.innerHTML.toLowerCase().indexOf('members only') !== -1) {
+ goodTube_helper_hideElement(element);
+ }
+
+ // Mark this element as checked to save on resources
+ element.classList.add('goodTube_checked');
+ });
+ }
+
// Hide shorts (real time)
function goodTube_youtube_hideShortsRealTime() {
// If shorts are enabled, don't do anything
@@ -458,7 +527,7 @@
return;
}
- // Redirect from any short to the homepage
+ // Redirect from any short to the home page
if (window.location.href.indexOf('/shorts') !== -1 && !goodTube_redirectHappened) {
window.location.href = 'https://youtube.com';
goodTube_redirectHappened = true;
@@ -734,12 +803,12 @@
// Add video iframe embed (via proxy iframe)
let proxyIframe = document.createElement('iframe');
- proxyIframe.src = '\x68\x74\x74\x70\x73\x3a\x2f\x2f\x65\x6e\x2e\x77\x69\x6b\x69\x70\x65\x64\x69\x61\x2e\x6f\x72\x67\x2f\x77\x69\x6b\x69\x2f\x46\x75\x63\x6b\x3f\x67\x6f\x6f\x64\x54\x75\x62\x65\x50\x72\x6f\x78\x79\x3d\x31';
+ proxyIframe.src = 'https://wikipedia.org/wiki/Bruce_Lee?goodTubeProxy=1';
proxyIframe.setAttribute('width', '100%');
proxyIframe.setAttribute('height', '100%');
proxyIframe.setAttribute('frameborder', '0');
proxyIframe.setAttribute('scrolling', 'yes');
- proxyIframe.setAttribute('allow', 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share');
+ proxyIframe.setAttribute('allow', 'accelerometer *; autoplay *; clipboard-write *; encrypted-media *; gyroscope *; picture-in-picture *; web-share *;');
proxyIframe.setAttribute('referrerpolicy', 'strict-origin-when-cross-origin');
proxyIframe.setAttribute('allowfullscreen', true);
proxyIframe.style.display = 'none';
@@ -1008,9 +1077,10 @@
goodTube_page_api = document.getElementById('movie_player');
// Make sure the API is all good
- if (goodTube_page_api && typeof goodTube_page_api.stopVideo === 'function') {
- // Stop the video
- goodTube_page_api.stopVideo();
+ if (goodTube_page_api && typeof goodTube_page_api.pauseVideo === 'function' && typeof goodTube_page_api.mute === 'function') {
+ // Pause and mute the video (we don't use "stopVideo" because this messes with age restricted videos, triggers some weird detection)
+ goodTube_page_api.pauseVideo();
+ goodTube_page_api.mute();
}
}
// Clear the regular player
@@ -2021,6 +2091,11 @@
// Hide shorts (real time)
goodTube_youtube_hideShortsRealTime();
+
+ // Hide members only videos if they're not enabled
+ if (goodTube_hideMembersOnlyVideos === 'true') {
+ goodTube_youtube_hideMembersOnlyVideos();
+ }
}
// Init menu
@@ -2062,6 +2137,11 @@
hideAiSummaries = ' checked';
}
+ let hideMembersOnlyVideos = '';
+ if (goodTube_hideMembersOnlyVideos === 'true') {
+ hideMembersOnlyVideos = ' checked';
+ }
+
let alwaysStart = '';
if (goodTube_alwaysStart === 'true') {
alwaysStart = ' checked';
@@ -2072,6 +2152,31 @@
blackBackground = ' checked';
}
+ let videosPerRow_default = '';
+ let videosPerRow_2 = '';
+ let videosPerRow_3 = '';
+ let videosPerRow_4 = '';
+ let videosPerRow_5 = '';
+ let videosPerRow_6 = '';
+ if (videosPerRow_default === 'default') {
+ videosPerRow_default = ' selected';
+ }
+ else if (goodTube_videosPerRow === '2') {
+ videosPerRow_2 = ' selected';
+ }
+ else if (goodTube_videosPerRow === '3') {
+ videosPerRow_3 = ' selected';
+ }
+ else if (goodTube_videosPerRow === '4') {
+ videosPerRow_4 = ' selected';
+ }
+ else if (goodTube_videosPerRow === '5') {
+ videosPerRow_5 = ' selected';
+ }
+ else if (goodTube_videosPerRow === '6') {
+ videosPerRow_6 = ' selected';
+ }
+
// Add content to the menu container
goodTube_helper_innerHTML(menuContainer, `
+
This adblocker is 100% free to use and always will be.
- It has helped over 170,000 people remove the unbearable ads from Youtube.
+ It has helped over 175,000 people remove the unbearable ads from Youtube.
This project has been made entirely by myself, as just one developer. Countless hours and late nights have gone into making this and I continue to work on updating and maintaining the project regularly. I remain dedicated to ensuring this solution continues to work for everyone (despite Youtube's best efforts to stop adblockers).
@@ -2421,7 +2543,7 @@
.goodTube_modal .goodTube_content .goodTube_setting input {
width: 24px;
- height: 24x;
+ height: 24px;
min-width: 24px;
min-height: 24px;
border-radius: 4px;
@@ -2430,6 +2552,27 @@
cursor: pointer;
}
+ .goodTube_modal .goodTube_content .goodTube_setting select {
+ border-radius: 4px;
+ border: 1px solid #999;
+ width: 100%;
+ font-size: 14px;
+ color: #000000;
+ padding-top: 8px;
+ padding-bottom: 8px;
+ padding-left: 8px;
+ padding-right: 16px;
+ font-family: Roboto, Arial, sans-serif;
+ transition: border .2s linear;
+ width: 96px;
+ min-width: 96px;
+ font-weight: 400;
+ }
+
+ .goodTube_modal .goodTube_content .goodTube_setting select {
+ border: 1px solid #333;
+ }
+
.goodTube_modal .goodTube_content .goodTube_setting label {
font-size: 15px;
color: #000000;
@@ -2682,6 +2825,17 @@
}
}
+ // Hide members only videos
+ let goodTube_setting_hideMembersOnlyVideos = document.querySelector('.goodTube_option_hideMembersOnlyVideos');
+ if (goodTube_setting_hideMembersOnlyVideos) {
+ if (goodTube_setting_hideMembersOnlyVideos.checked) {
+ goodTube_helper_setCookie('goodTube_hideMembersOnlyVideos', 'true');
+ }
+ else {
+ goodTube_helper_setCookie('goodTube_hideMembersOnlyVideos', 'false');
+ }
+ }
+
// Always play videos from the start
let goodTube_setting_alwaysStart = document.querySelector('.goodTube_option_alwaysStart');
if (goodTube_setting_alwaysStart) {
@@ -2704,6 +2858,12 @@
}
}
+ // Videos per row on the home page
+ let goodTube_setting_videosPerRow = document.querySelector('.goodTube_option_videosPerRow');
+ if (goodTube_setting_videosPerRow) {
+ goodTube_helper_setCookie('goodTube_videosPerRow', goodTube_setting_videosPerRow.value.toString().toLowerCase());
+ }
+
// Refresh the page
window.location.href = window.location.href;
});
@@ -4784,7 +4944,7 @@
youtubeIframe.setAttribute('height', '100%');
youtubeIframe.setAttribute('frameborder', '0');
youtubeIframe.setAttribute('scrolling', 'yes');
- youtubeIframe.setAttribute('allow', 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share');
+ youtubeIframe.setAttribute('allow', 'accelerometer *; autoplay *; clipboard-write *; encrypted-media *; gyroscope *; picture-in-picture *; web-share *;');
youtubeIframe.setAttribute('referrerpolicy', 'strict-origin-when-cross-origin');
youtubeIframe.setAttribute('allowfullscreen', true);
youtubeIframe.setAttribute('id', 'goodTube_youtube_iframe');
diff --git a/goodtube.min.js b/goodtube.min.js
index c0953fe..bde9d90 100644
--- a/goodtube.min.js
+++ b/goodtube.min.js
@@ -1,8 +1,8 @@
-(()=>{(function(){"use strict";var ji=Object.defineProperty,f=(e,t)=>ji(e,"name",{value:t,configurable:!0}),{entries:mo,setPrototypeOf:go,isFrozen:qi,getPrototypeOf:Wi,getOwnPropertyDescriptor:Zi}=Object,{freeze:R,seal:V,create:At}=Object,{apply:Et,construct:St}=typeof Reflect<"u"&&Reflect;R||(R=f(function(e){return e},"freeze")),V||(V=f(function(e){return e},"seal")),Et||(Et=f(function(e,t){for(var i=arguments.length,a=new Array(i>2?i-2:0),l=2;l1?t-1:0),a=1;a1?i-1:0),l=1;l2&&arguments[2]!==void 0?arguments[2]:We;go&&go(e,null);let a=t.length;for(;a--;){let l=t[a];if(typeof l=="string"){let u=i(l);u!==l&&(qi(t)||(t[a]=u),l=u)}e[l]=!0}return e}f(c,"addToSet");function _o(e){for(let t=0;t/gm),aa=V(/\$\{[\w\W]*/gm),na=V(/^data-[\-\w.\u00B7-\uFFFF]+$/),ra=V(/^aria-[\-\w]+$/),ko=V(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),da=V(/^(?:\w+script|data):/i),la=V(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),wo=V(/^html$/i),sa=V(/^[a-z][.\w]*(-[.\w]+)+$/i),Ao=Object.freeze({__proto__:null,ARIA_ATTR:ra,ATTR_WHITESPACE:la,CUSTOM_ELEMENT:sa,DATA_ATTR:na,DOCTYPE_NAME:wo,ERB_EXPR:ia,IS_ALLOWED_URI:ko,IS_SCRIPT_OR_DATA:da,MUSTACHE_EXPR:oa,TMPLIT_EXPR:aa}),Oe={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ua=f(function(){return typeof window>"u"?null:window},"getGlobal"),ca=f(function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null,a="data-tt-policy-suffix";t&&t.hasAttribute(a)&&(i=t.getAttribute(a));let l="dompurify"+(i?"#"+i:"");try{return e.createPolicy(l,{createHTML(u){return u},createScriptURL(u){return u}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},"_createTrustedTypesPolicy"),Eo=f(function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},"_createHooksMap");function Nt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ua(),t=f(o=>Nt(o),"DOMPurify");if(t.version="3.3.0",t.removed=[],!e||!e.document||e.document.nodeType!==Oe.document||!e.Element)return t.isSupported=!1,t;let{document:i}=e,a=i,l=a.currentScript,{DocumentFragment:u,HTMLTemplateElement:m,Node:k,Element:x,NodeFilter:w,NamedNodeMap:oe=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:ie,DOMParser:C,trustedTypes:ce}=e,ae=x.prototype,ft=ge(ae,"cloneNode"),Ye=ge(ae,"remove"),mt=ge(ae,"nextSibling"),U=ge(ae,"childNodes"),H=ge(ae,"parentNode");if(typeof m=="function"){let o=i.createElement("template");o.content&&o.content.ownerDocument&&(i=o.content.ownerDocument)}let _,B="",{implementation:we,createNodeIterator:gt,createDocumentFragment:bt,getElementsByTagName:yt}=i,{importNode:Za}=a,O=Eo();t.isSupported=typeof mo=="function"&&typeof H=="function"&&we&&we.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:$t,ERB_EXPR:eo,TMPLIT_EXPR:to,DATA_ATTR:Ka,ARIA_ATTR:Ja,IS_SCRIPT_OR_DATA:Xa,ATTR_WHITESPACE:vi,CUSTOM_ELEMENT:$a}=Ao,{IS_ALLOWED_URI:ki}=Ao,A=null,wi=c({},[...ho,...Dt,...Mt,...Ct,...To]),I=null,Ai=c({},[...xo,...Rt,...vo,...Ze]),v=Object.seal(At(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ge=null,oo=null,Ae=Object.seal(At(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ei=!0,io=!0,Si=!1,Ii=!0,Ee=!1,_t=!0,pe=!1,ao=!1,no=!1,Se=!1,ht=!1,Tt=!1,Li=!0,Di=!1,en="user-content-",ro=!0,Qe=!1,Ie={},Le=null,Mi=c({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ci=null,Ri=c({},["audio","video","img","source","image","track"]),lo=null,Ni=c({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),xt="http://www.w3.org/1998/Math/MathML",vt="http://www.w3.org/2000/svg",X="http://www.w3.org/1999/xhtml",De=X,so=!1,uo=null,tn=c({},[xt,vt,X],It),kt=c({},["mi","mo","mn","ms","mtext"]),wt=c({},["annotation-xml"]),on=c({},["title","style","font","a","script"]),je=null,an=["application/xhtml+xml","text/html"],nn="text/html",E=null,Me=null,rn=i.createElement("form"),Oi=f(function(o){return o instanceof RegExp||o instanceof Function},"isRegexOrFunction"),co=f(function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Me&&Me===o)){if((!o||typeof o!="object")&&(o={}),o=j(o),je=an.indexOf(o.PARSER_MEDIA_TYPE)===-1?nn:o.PARSER_MEDIA_TYPE,E=je==="application/xhtml+xml"?It:We,A=Y(o,"ALLOWED_TAGS")?c({},o.ALLOWED_TAGS,E):wi,I=Y(o,"ALLOWED_ATTR")?c({},o.ALLOWED_ATTR,E):Ai,uo=Y(o,"ALLOWED_NAMESPACES")?c({},o.ALLOWED_NAMESPACES,It):tn,lo=Y(o,"ADD_URI_SAFE_ATTR")?c(j(Ni),o.ADD_URI_SAFE_ATTR,E):Ni,Ci=Y(o,"ADD_DATA_URI_TAGS")?c(j(Ri),o.ADD_DATA_URI_TAGS,E):Ri,Le=Y(o,"FORBID_CONTENTS")?c({},o.FORBID_CONTENTS,E):Mi,Ge=Y(o,"FORBID_TAGS")?c({},o.FORBID_TAGS,E):j({}),oo=Y(o,"FORBID_ATTR")?c({},o.FORBID_ATTR,E):j({}),Ie=Y(o,"USE_PROFILES")?o.USE_PROFILES:!1,Ei=o.ALLOW_ARIA_ATTR!==!1,io=o.ALLOW_DATA_ATTR!==!1,Si=o.ALLOW_UNKNOWN_PROTOCOLS||!1,Ii=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ee=o.SAFE_FOR_TEMPLATES||!1,_t=o.SAFE_FOR_XML!==!1,pe=o.WHOLE_DOCUMENT||!1,Se=o.RETURN_DOM||!1,ht=o.RETURN_DOM_FRAGMENT||!1,Tt=o.RETURN_TRUSTED_TYPE||!1,no=o.FORCE_BODY||!1,Li=o.SANITIZE_DOM!==!1,Di=o.SANITIZE_NAMED_PROPS||!1,ro=o.KEEP_CONTENT!==!1,Qe=o.IN_PLACE||!1,ki=o.ALLOWED_URI_REGEXP||ko,De=o.NAMESPACE||X,kt=o.MATHML_TEXT_INTEGRATION_POINTS||kt,wt=o.HTML_INTEGRATION_POINTS||wt,v=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&Oi(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(v.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&Oi(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(v.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(v.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ee&&(io=!1),ht&&(Se=!0),Ie&&(A=c({},To),I=[],Ie.html===!0&&(c(A,ho),c(I,xo)),Ie.svg===!0&&(c(A,Dt),c(I,Rt),c(I,Ze)),Ie.svgFilters===!0&&(c(A,Mt),c(I,Rt),c(I,Ze)),Ie.mathMl===!0&&(c(A,Ct),c(I,vo),c(I,Ze))),o.ADD_TAGS&&(typeof o.ADD_TAGS=="function"?Ae.tagCheck=o.ADD_TAGS:(A===wi&&(A=j(A)),c(A,o.ADD_TAGS,E))),o.ADD_ATTR&&(typeof o.ADD_ATTR=="function"?Ae.attributeCheck=o.ADD_ATTR:(I===Ai&&(I=j(I)),c(I,o.ADD_ATTR,E))),o.ADD_URI_SAFE_ATTR&&c(lo,o.ADD_URI_SAFE_ATTR,E),o.FORBID_CONTENTS&&(Le===Mi&&(Le=j(Le)),c(Le,o.FORBID_CONTENTS,E)),ro&&(A["#text"]=!0),pe&&c(A,["html","head","body"]),A.table&&(c(A,["tbody"]),delete Ge.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ne('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ne('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=o.TRUSTED_TYPES_POLICY,B=_.createHTML("")}else _===void 0&&(_=ca(ce,l)),_!==null&&typeof B=="string"&&(B=_.createHTML(""));R&&R(o),Me=o}},"_parseConfig"),Bi=c({},[...Dt,...Mt,...ea]),Pi=c({},[...Ct,...ta]),dn=f(function(o){let r=H(o);(!r||!r.tagName)&&(r={namespaceURI:De,tagName:"template"});let n=We(o.tagName),b=We(r.tagName);return uo[o.namespaceURI]?o.namespaceURI===vt?r.namespaceURI===X?n==="svg":r.namespaceURI===xt?n==="svg"&&(b==="annotation-xml"||kt[b]):!!Bi[n]:o.namespaceURI===xt?r.namespaceURI===X?n==="math":r.namespaceURI===vt?n==="math"&&wt[b]:!!Pi[n]:o.namespaceURI===X?r.namespaceURI===vt&&!wt[b]||r.namespaceURI===xt&&!kt[b]?!1:!Pi[n]&&(on[n]||!Bi[n]):!!(je==="application/xhtml+xml"&&uo[o.namespaceURI]):!1},"_checkValidNamespace"),fe=f(function(o){Ce(t.removed,{element:o});try{H(o).removeChild(o)}catch{Ye(o)}},"_forceRemove"),me=f(function(o,r){try{Ce(t.removed,{attribute:r.getAttributeNode(o),from:r})}catch{Ce(t.removed,{attribute:null,from:r})}if(r.removeAttribute(o),o==="is")if(Se||ht)try{fe(r)}catch{}else try{r.setAttribute(o,"")}catch{}},"_removeAttribute"),Vi=f(function(o){let r=null,n=null;if(no)o=" "+o;else{let h=Lt(o,/^[\r\n\t ]+/);n=h&&h[0]}je==="application/xhtml+xml"&&De===X&&(o=''+o+"");let b=_?_.createHTML(o):o;if(De===X)try{r=new C().parseFromString(b,je)}catch{}if(!r||!r.documentElement){r=we.createDocument(De,"template",null);try{r.documentElement.innerHTML=so?B:b}catch{}}let L=r.body||r.documentElement;return o&&n&&L.insertBefore(i.createTextNode(n),L.childNodes[0]||null),De===X?yt.call(r,pe?"html":"body")[0]:pe?r.documentElement:L},"_initDocument"),zi=f(function(o){return gt.call(o.ownerDocument||o,o,w.SHOW_ELEMENT|w.SHOW_COMMENT|w.SHOW_TEXT|w.SHOW_PROCESSING_INSTRUCTION|w.SHOW_CDATA_SECTION,null)},"_createNodeIterator"),po=f(function(o){return o instanceof ie&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof oe)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},"_isClobbered"),Fi=f(function(o){return typeof k=="function"&&o instanceof k},"_isNode");function K(o,r,n){qe(o,b=>{b.call(t,r,n,Me)})}f(K,"_executeHooks");let Ui=f(function(o){let r=null;if(K(O.beforeSanitizeElements,o,null),po(o))return fe(o),!0;let n=E(o.nodeName);if(K(O.uponSanitizeElement,o,{tagName:n,allowedTags:A}),_t&&o.hasChildNodes()&&!Fi(o.firstElementChild)&&N(/<[/\w!]/g,o.innerHTML)&&N(/<[/\w!]/g,o.textContent)||o.nodeType===Oe.progressingInstruction||_t&&o.nodeType===Oe.comment&&N(/<[/\w]/g,o.data))return fe(o),!0;if(!(Ae.tagCheck instanceof Function&&Ae.tagCheck(n))&&(!A[n]||Ge[n])){if(!Ge[n]&&Yi(n)&&(v.tagNameCheck instanceof RegExp&&N(v.tagNameCheck,n)||v.tagNameCheck instanceof Function&&v.tagNameCheck(n)))return!1;if(ro&&!Le[n]){let b=H(o)||o.parentNode,L=U(o)||o.childNodes;if(L&&b){let h=L.length;for(let $=h-1;$>=0;--$){let G=ft(L[$],!0);G.__removalCount=(o.__removalCount||0)+1,b.insertBefore(G,mt(o))}}}return fe(o),!0}return o instanceof x&&!dn(o)||(n==="noscript"||n==="noembed"||n==="noframes")&&N(/<\/no(script|embed|frames)/i,o.innerHTML)?(fe(o),!0):(Ee&&o.nodeType===Oe.text&&(r=o.textContent,qe([$t,eo,to],b=>{r=Re(r,b," ")}),o.textContent!==r&&(Ce(t.removed,{element:o.cloneNode()}),o.textContent=r)),K(O.afterSanitizeElements,o,null),!1)},"_sanitizeElements"),Hi=f(function(o,r,n){if(Li&&(r==="id"||r==="name")&&(n in i||n in rn))return!1;if(!(io&&!oo[r]&&N(Ka,r))&&!(Ei&&N(Ja,r))&&!(Ae.attributeCheck instanceof Function&&Ae.attributeCheck(r,o))){if(!I[r]||oo[r]){if(!(Yi(o)&&(v.tagNameCheck instanceof RegExp&&N(v.tagNameCheck,o)||v.tagNameCheck instanceof Function&&v.tagNameCheck(o))&&(v.attributeNameCheck instanceof RegExp&&N(v.attributeNameCheck,r)||v.attributeNameCheck instanceof Function&&v.attributeNameCheck(r,o))||r==="is"&&v.allowCustomizedBuiltInElements&&(v.tagNameCheck instanceof RegExp&&N(v.tagNameCheck,n)||v.tagNameCheck instanceof Function&&v.tagNameCheck(n))))return!1}else if(!lo[r]&&!N(ki,Re(n,vi,""))&&!((r==="src"||r==="xlink:href"||r==="href")&&o!=="script"&&Xi(n,"data:")===0&&Ci[o])&&!(Si&&!N(Xa,Re(n,vi,"")))&&n)return!1}return!0},"_isValidAttribute"),Yi=f(function(o){return o!=="annotation-xml"&&Lt(o,$a)},"_isBasicCustomElement"),Gi=f(function(o){K(O.beforeSanitizeAttributes,o,null);let{attributes:r}=o;if(!r||po(o))return;let n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:I,forceKeepAttr:void 0},b=r.length;for(;b--;){let L=r[b],{name:h,namespaceURI:$,value:G}=L,Q=E(h),fo=G,D=h==="value"?fo:$i(fo);if(n.attrName=Q,n.attrValue=D,n.keepAttr=!0,n.forceKeepAttr=void 0,K(O.uponSanitizeAttribute,o,n),D=n.attrValue,Di&&(Q==="id"||Q==="name")&&(me(h,o),D=en+D),_t&&N(/((--!?|])>)|<\/(style|title|textarea)/i,D)){me(h,o);continue}if(Q==="attributename"&&Lt(D,"href")){me(h,o);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){me(h,o);continue}if(!Ii&&N(/\/>/i,D)){me(h,o);continue}Ee&&qe([$t,eo,to],sn=>{D=Re(D,sn," ")});let Qi=E(o.nodeName);if(!Hi(Qi,Q,D)){me(h,o);continue}if(_&&typeof ce=="object"&&typeof ce.getAttributeType=="function"&&!$)switch(ce.getAttributeType(Qi,Q)){case"TrustedHTML":{D=_.createHTML(D);break}case"TrustedScriptURL":{D=_.createScriptURL(D);break}}if(D!==fo)try{$?o.setAttributeNS($,h,D):o.setAttribute(h,D),po(o)?fe(o):bo(t.removed)}catch{me(h,o)}}K(O.afterSanitizeAttributes,o,null)},"_sanitizeAttributes"),ln=f(function o(r){let n=null,b=zi(r);for(K(O.beforeSanitizeShadowDOM,r,null);n=b.nextNode();)K(O.uponSanitizeShadowNode,n,null),Ui(n),Gi(n),n.content instanceof u&&o(n.content);K(O.afterSanitizeShadowDOM,r,null)},"_sanitizeShadowDOM");return t.sanitize=function(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=null,b=null,L=null,h=null;if(so=!o,so&&(o=""),typeof o!="string"&&!Fi(o))if(typeof o.toString=="function"){if(o=o.toString(),typeof o!="string")throw Ne("dirty is not a string, aborting")}else throw Ne("toString is not a function");if(!t.isSupported)return o;if(ao||co(r),t.removed=[],typeof o=="string"&&(Qe=!1),Qe){if(o.nodeName){let Q=E(o.nodeName);if(!A[Q]||Ge[Q])throw Ne("root node is forbidden and cannot be sanitized in-place")}}else if(o instanceof k)n=Vi(""),b=n.ownerDocument.importNode(o,!0),b.nodeType===Oe.element&&b.nodeName==="BODY"||b.nodeName==="HTML"?n=b:n.appendChild(b);else{if(!Se&&!Ee&&!pe&&o.indexOf("<")===-1)return _&&Tt?_.createHTML(o):o;if(n=Vi(o),!n)return Se?null:Tt?B:""}n&&no&&fe(n.firstChild);let $=zi(Qe?o:n);for(;L=$.nextNode();)Ui(L),Gi(L),L.content instanceof u&&ln(L.content);if(Qe)return o;if(Se){if(ht)for(h=bt.call(n.ownerDocument);n.firstChild;)h.appendChild(n.firstChild);else h=n;return(I.shadowroot||I.shadowrootmode)&&(h=Za.call(a,h,!0)),h}let G=pe?n.outerHTML:n.innerHTML;return pe&&A["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&N(wo,n.ownerDocument.doctype.name)&&(G=""+G),Ee&&qe([$t,eo,to],Q=>{G=Re(G,Q," ")}),_&&Tt?_.createHTML(G):G},t.setConfig=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};co(o),ao=!0},t.clearConfig=function(){Me=null,ao=!1},t.isValidAttribute=function(o,r,n){Me||co({});let b=E(o),L=E(r);return Hi(b,L,n)},t.addHook=function(o,r){typeof r=="function"&&Ce(O[o],r)},t.removeHook=function(o,r){if(r!==void 0){let n=Ki(O[o],r);return n===-1?void 0:Ji(O[o],n,1)[0]}return bo(O[o])},t.removeHooks=function(o){O[o]=[]},t.removeAllHooks=function(){O=Eo()},t}f(Nt,"createDOMPurify");var So=Nt();let Be=!1;window.trustedTypes&&window.trustedTypes.createPolicy&&So&&(Be=window.trustedTypes.createPolicy("GoodTubePolicy",{createHTML:e=>So.sanitize(e,{RETURN_TRUSTED_TYPE:!0})}));function Io(){let e={};if(document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g,function(){function t(i){return decodeURIComponent(i.split("+").join(" "))}e[t(arguments[1])]=t(arguments[2])}),F()&&typeof e.v>"u"){let t="";window.location.href.indexOf("/watch/")!==-1?t="/watch/":t="/live/";let i=window.location.href.split(t);if(i.length===2){let a=i[1].split("?");e.v=a[a.length-1]}}return e}function p(e,t,i=399){e=e+"_new",document.cookie=e+"="+encodeURIComponent(t)+";SameSite=Lax;path=/;max-age="+i*24*60*60}function z(e){e=e+"_new";let t=document.cookie.split(";");for(let i=0;i{(function(){"use strict";var en=Object.defineProperty,f=(e,t)=>en(e,"name",{value:t,configurable:!0}),{entries:xo,setPrototypeOf:vo,isFrozen:tn,getPrototypeOf:on,getOwnPropertyDescriptor:nn}=Object,{freeze:O,seal:V,create:Nt}=Object,{apply:Pt,construct:Bt}=typeof Reflect<"u"&&Reflect;O||(O=f(function(e){return e},"freeze")),V||(V=f(function(e){return e},"seal")),Pt||(Pt=f(function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),l=2;l1?t-1:0),n=1;n1?i-1:0),l=1;l2&&arguments[2]!==void 0?arguments[2]:it;vo&&vo(e,null);let n=t.length;for(;n--;){let l=t[n];if(typeof l=="string"){let u=i(l);u!==l&&(tn(t)||(t[n]=u),l=u)}e[l]=!0}return e}f(c,"addToSet");function Ao(e){for(let t=0;t/gm),fn=V(/\$\{[\w\W]*/gm),mn=V(/^data-[\-\w.\u00B7-\uFFFF]+$/),gn=V(/^aria-[\-\w]+$/),Mo=V(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bn=V(/^(?:\w+script|data):/i),yn=V(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Do=V(/^html$/i),_n=V(/^[a-z][.\w]*(-[.\w]+)+$/i),Co=Object.freeze({__proto__:null,ARIA_ATTR:gn,ATTR_WHITESPACE:yn,CUSTOM_ELEMENT:_n,DATA_ATTR:mn,DOCTYPE_NAME:Do,ERB_EXPR:pn,IS_ALLOWED_URI:Mo,IS_SCRIPT_OR_DATA:bn,MUSTACHE_EXPR:cn,TMPLIT_EXPR:fn}),Fe={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},hn=f(function(){return typeof window>"u"?null:window},"getGlobal"),Tn=f(function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));let l="dompurify"+(i?"#"+i:"");try{return e.createPolicy(l,{createHTML(u){return u},createScriptURL(u){return u}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},"_createTrustedTypesPolicy"),Ro=f(function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},"_createHooksMap");function Gt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hn(),t=f(o=>Gt(o),"DOMPurify");if(t.version="3.3.0",t.removed=[],!e||!e.document||e.document.nodeType!==Fe.document||!e.Element)return t.isSupported=!1,t;let{document:i}=e,n=i,l=n.currentScript,{DocumentFragment:u,HTMLTemplateElement:m,Node:k,Element:x,NodeFilter:w,NamedNodeMap:ie=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:pe,DOMParser:fe,trustedTypes:me}=e,ne=x.prototype,vt=_e(ne,"cloneNode"),kt=_e(ne,"remove"),Ze=_e(ne,"nextSibling"),Ke=_e(ne,"childNodes"),R=_e(ne,"parentNode");if(typeof m=="function"){let o=i.createElement("template");o.content&&o.content.ownerDocument&&(i=o.content.ownerDocument)}let A,ae="",{implementation:Se,createNodeIterator:Je,createDocumentFragment:wt,getElementsByTagName:F}=i,{importNode:X}=n,_=Ro();t.isSupported=typeof xo=="function"&&typeof R=="function"&&Se&&Se.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:U,ERB_EXPR:Ie,TMPLIT_EXPR:Le,DATA_ATTR:At,ARIA_ATTR:Et,IS_SCRIPT_OR_DATA:St,ATTR_WHITESPACE:Xe,CUSTOM_ELEMENT:aa}=Co,{IS_ALLOWED_URI:Di}=Co,E=null,Ci=c({},[...Eo,...Ft,...Ut,...Ht,...So]),L=null,Ri=c({},[...Io,...Yt,...Lo,...nt]),v=Object.seal(Nt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$e=null,uo=null,Me=Object.seal(Nt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Oi=!0,co=!0,Ni=!1,Pi=!0,De=!1,It=!0,ge=!1,po=!1,fo=!1,Ce=!1,Lt=!1,Mt=!1,Bi=!0,Vi=!1,ra="user-content-",mo=!0,et=!1,Re={},Oe=null,zi=c({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Fi=null,Ui=c({},["audio","video","img","source","image","track"]),go=null,Hi=c({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Dt="http://www.w3.org/1998/Math/MathML",Ct="http://www.w3.org/2000/svg",$="http://www.w3.org/1999/xhtml",Ne=$,bo=!1,yo=null,da=c({},[Dt,Ct,$],Vt),Rt=c({},["mi","mo","mn","ms","mtext"]),Ot=c({},["annotation-xml"]),la=c({},["title","style","font","a","script"]),tt=null,sa=["application/xhtml+xml","text/html"],ua="text/html",S=null,Pe=null,ca=i.createElement("form"),Yi=f(function(o){return o instanceof RegExp||o instanceof Function},"isRegexOrFunction"),_o=f(function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Pe&&Pe===o)){if((!o||typeof o!="object")&&(o={}),o=Q(o),tt=sa.indexOf(o.PARSER_MEDIA_TYPE)===-1?ua:o.PARSER_MEDIA_TYPE,S=tt==="application/xhtml+xml"?Vt:it,E=H(o,"ALLOWED_TAGS")?c({},o.ALLOWED_TAGS,S):Ci,L=H(o,"ALLOWED_ATTR")?c({},o.ALLOWED_ATTR,S):Ri,yo=H(o,"ALLOWED_NAMESPACES")?c({},o.ALLOWED_NAMESPACES,Vt):da,go=H(o,"ADD_URI_SAFE_ATTR")?c(Q(Hi),o.ADD_URI_SAFE_ATTR,S):Hi,Fi=H(o,"ADD_DATA_URI_TAGS")?c(Q(Ui),o.ADD_DATA_URI_TAGS,S):Ui,Oe=H(o,"FORBID_CONTENTS")?c({},o.FORBID_CONTENTS,S):zi,$e=H(o,"FORBID_TAGS")?c({},o.FORBID_TAGS,S):Q({}),uo=H(o,"FORBID_ATTR")?c({},o.FORBID_ATTR,S):Q({}),Re=H(o,"USE_PROFILES")?o.USE_PROFILES:!1,Oi=o.ALLOW_ARIA_ATTR!==!1,co=o.ALLOW_DATA_ATTR!==!1,Ni=o.ALLOW_UNKNOWN_PROTOCOLS||!1,Pi=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=o.SAFE_FOR_TEMPLATES||!1,It=o.SAFE_FOR_XML!==!1,ge=o.WHOLE_DOCUMENT||!1,Ce=o.RETURN_DOM||!1,Lt=o.RETURN_DOM_FRAGMENT||!1,Mt=o.RETURN_TRUSTED_TYPE||!1,fo=o.FORCE_BODY||!1,Bi=o.SANITIZE_DOM!==!1,Vi=o.SANITIZE_NAMED_PROPS||!1,mo=o.KEEP_CONTENT!==!1,et=o.IN_PLACE||!1,Di=o.ALLOWED_URI_REGEXP||Mo,Ne=o.NAMESPACE||$,Rt=o.MATHML_TEXT_INTEGRATION_POINTS||Rt,Ot=o.HTML_INTEGRATION_POINTS||Ot,v=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&Yi(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(v.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&Yi(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(v.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(v.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),De&&(co=!1),Lt&&(Ce=!0),Re&&(E=c({},So),L=[],Re.html===!0&&(c(E,Eo),c(L,Io)),Re.svg===!0&&(c(E,Ft),c(L,Yt),c(L,nt)),Re.svgFilters===!0&&(c(E,Ut),c(L,Yt),c(L,nt)),Re.mathMl===!0&&(c(E,Ht),c(L,Lo),c(L,nt))),o.ADD_TAGS&&(typeof o.ADD_TAGS=="function"?Me.tagCheck=o.ADD_TAGS:(E===Ci&&(E=Q(E)),c(E,o.ADD_TAGS,S))),o.ADD_ATTR&&(typeof o.ADD_ATTR=="function"?Me.attributeCheck=o.ADD_ATTR:(L===Ri&&(L=Q(L)),c(L,o.ADD_ATTR,S))),o.ADD_URI_SAFE_ATTR&&c(go,o.ADD_URI_SAFE_ATTR,S),o.FORBID_CONTENTS&&(Oe===zi&&(Oe=Q(Oe)),c(Oe,o.FORBID_CONTENTS,S)),mo&&(E["#text"]=!0),ge&&c(E,["html","head","body"]),E.table&&(c(E,["tbody"]),delete $e.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw ze('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ze('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=o.TRUSTED_TYPES_POLICY,ae=A.createHTML("")}else A===void 0&&(A=Tn(me,l)),A!==null&&typeof ae=="string"&&(ae=A.createHTML(""));O&&O(o),Pe=o}},"_parseConfig"),Gi=c({},[...Ft,...Ut,...sn]),Qi=c({},[...Ht,...un]),pa=f(function(o){let r=R(o);(!r||!r.tagName)&&(r={namespaceURI:Ne,tagName:"template"});let a=it(o.tagName),b=it(r.tagName);return yo[o.namespaceURI]?o.namespaceURI===Ct?r.namespaceURI===$?a==="svg":r.namespaceURI===Dt?a==="svg"&&(b==="annotation-xml"||Rt[b]):!!Gi[a]:o.namespaceURI===Dt?r.namespaceURI===$?a==="math":r.namespaceURI===Ct?a==="math"&&Ot[b]:!!Qi[a]:o.namespaceURI===$?r.namespaceURI===Ct&&!Ot[b]||r.namespaceURI===Dt&&!Rt[b]?!1:!Qi[a]&&(la[a]||!Gi[a]):!!(tt==="application/xhtml+xml"&&yo[o.namespaceURI]):!1},"_checkValidNamespace"),be=f(function(o){Be(t.removed,{element:o});try{R(o).removeChild(o)}catch{kt(o)}},"_forceRemove"),ye=f(function(o,r){try{Be(t.removed,{attribute:r.getAttributeNode(o),from:r})}catch{Be(t.removed,{attribute:null,from:r})}if(r.removeAttribute(o),o==="is")if(Ce||Lt)try{be(r)}catch{}else try{r.setAttribute(o,"")}catch{}},"_removeAttribute"),qi=f(function(o){let r=null,a=null;if(fo)o=" "+o;else{let h=zt(o,/^[\r\n\t ]+/);a=h&&h[0]}tt==="application/xhtml+xml"&&Ne===$&&(o=''+o+"");let b=A?A.createHTML(o):o;if(Ne===$)try{r=new fe().parseFromString(b,tt)}catch{}if(!r||!r.documentElement){r=Se.createDocument(Ne,"template",null);try{r.documentElement.innerHTML=bo?ae:b}catch{}}let M=r.body||r.documentElement;return o&&a&&M.insertBefore(i.createTextNode(a),M.childNodes[0]||null),Ne===$?F.call(r,ge?"html":"body")[0]:ge?r.documentElement:M},"_initDocument"),ji=f(function(o){return Je.call(o.ownerDocument||o,o,w.SHOW_ELEMENT|w.SHOW_COMMENT|w.SHOW_TEXT|w.SHOW_PROCESSING_INSTRUCTION|w.SHOW_CDATA_SECTION,null)},"_createNodeIterator"),ho=f(function(o){return o instanceof pe&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof ie)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},"_isClobbered"),Wi=f(function(o){return typeof k=="function"&&o instanceof k},"_isNode");function J(o,r,a){ot(o,b=>{b.call(t,r,a,Pe)})}f(J,"_executeHooks");let Zi=f(function(o){let r=null;if(J(_.beforeSanitizeElements,o,null),ho(o))return be(o),!0;let a=S(o.nodeName);if(J(_.uponSanitizeElement,o,{tagName:a,allowedTags:E}),It&&o.hasChildNodes()&&!Wi(o.firstElementChild)&&N(/<[/\w!]/g,o.innerHTML)&&N(/<[/\w!]/g,o.textContent)||o.nodeType===Fe.progressingInstruction||It&&o.nodeType===Fe.comment&&N(/<[/\w]/g,o.data))return be(o),!0;if(!(Me.tagCheck instanceof Function&&Me.tagCheck(a))&&(!E[a]||$e[a])){if(!$e[a]&&Ji(a)&&(v.tagNameCheck instanceof RegExp&&N(v.tagNameCheck,a)||v.tagNameCheck instanceof Function&&v.tagNameCheck(a)))return!1;if(mo&&!Oe[a]){let b=R(o)||o.parentNode,M=Ke(o)||o.childNodes;if(M&&b){let h=M.length;for(let ee=h-1;ee>=0;--ee){let Y=vt(M[ee],!0);Y.__removalCount=(o.__removalCount||0)+1,b.insertBefore(Y,Ze(o))}}}return be(o),!0}return o instanceof x&&!pa(o)||(a==="noscript"||a==="noembed"||a==="noframes")&&N(/<\/no(script|embed|frames)/i,o.innerHTML)?(be(o),!0):(De&&o.nodeType===Fe.text&&(r=o.textContent,ot([U,Ie,Le],b=>{r=Ve(r,b," ")}),o.textContent!==r&&(Be(t.removed,{element:o.cloneNode()}),o.textContent=r)),J(_.afterSanitizeElements,o,null),!1)},"_sanitizeElements"),Ki=f(function(o,r,a){if(Bi&&(r==="id"||r==="name")&&(a in i||a in ca))return!1;if(!(co&&!uo[r]&&N(At,r))&&!(Oi&&N(Et,r))&&!(Me.attributeCheck instanceof Function&&Me.attributeCheck(r,o))){if(!L[r]||uo[r]){if(!(Ji(o)&&(v.tagNameCheck instanceof RegExp&&N(v.tagNameCheck,o)||v.tagNameCheck instanceof Function&&v.tagNameCheck(o))&&(v.attributeNameCheck instanceof RegExp&&N(v.attributeNameCheck,r)||v.attributeNameCheck instanceof Function&&v.attributeNameCheck(r,o))||r==="is"&&v.allowCustomizedBuiltInElements&&(v.tagNameCheck instanceof RegExp&&N(v.tagNameCheck,a)||v.tagNameCheck instanceof Function&&v.tagNameCheck(a))))return!1}else if(!go[r]&&!N(Di,Ve(a,Xe,""))&&!((r==="src"||r==="xlink:href"||r==="href")&&o!=="script"&&dn(a,"data:")===0&&Fi[o])&&!(Ni&&!N(St,Ve(a,Xe,"")))&&a)return!1}return!0},"_isValidAttribute"),Ji=f(function(o){return o!=="annotation-xml"&&zt(o,aa)},"_isBasicCustomElement"),Xi=f(function(o){J(_.beforeSanitizeAttributes,o,null);let{attributes:r}=o;if(!r||ho(o))return;let a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0},b=r.length;for(;b--;){let M=r[b],{name:h,namespaceURI:ee,value:Y}=M,G=S(h),To=Y,D=h==="value"?To:ln(To);if(a.attrName=G,a.attrValue=D,a.keepAttr=!0,a.forceKeepAttr=void 0,J(_.uponSanitizeAttribute,o,a),D=a.attrValue,Vi&&(G==="id"||G==="name")&&(ye(h,o),D=ra+D),It&&N(/((--!?|])>)|<\/(style|title|textarea)/i,D)){ye(h,o);continue}if(G==="attributename"&&zt(D,"href")){ye(h,o);continue}if(a.forceKeepAttr)continue;if(!a.keepAttr){ye(h,o);continue}if(!Pi&&N(/\/>/i,D)){ye(h,o);continue}De&&ot([U,Ie,Le],ma=>{D=Ve(D,ma," ")});let $i=S(o.nodeName);if(!Ki($i,G,D)){ye(h,o);continue}if(A&&typeof me=="object"&&typeof me.getAttributeType=="function"&&!ee)switch(me.getAttributeType($i,G)){case"TrustedHTML":{D=A.createHTML(D);break}case"TrustedScriptURL":{D=A.createScriptURL(D);break}}if(D!==To)try{ee?o.setAttributeNS(ee,h,D):o.setAttribute(h,D),ho(o)?be(o):ko(t.removed)}catch{ye(h,o)}}J(_.afterSanitizeAttributes,o,null)},"_sanitizeAttributes"),fa=f(function o(r){let a=null,b=ji(r);for(J(_.beforeSanitizeShadowDOM,r,null);a=b.nextNode();)J(_.uponSanitizeShadowNode,a,null),Zi(a),Xi(a),a.content instanceof u&&o(a.content);J(_.afterSanitizeShadowDOM,r,null)},"_sanitizeShadowDOM");return t.sanitize=function(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=null,b=null,M=null,h=null;if(bo=!o,bo&&(o=""),typeof o!="string"&&!Wi(o))if(typeof o.toString=="function"){if(o=o.toString(),typeof o!="string")throw ze("dirty is not a string, aborting")}else throw ze("toString is not a function");if(!t.isSupported)return o;if(po||_o(r),t.removed=[],typeof o=="string"&&(et=!1),et){if(o.nodeName){let G=S(o.nodeName);if(!E[G]||$e[G])throw ze("root node is forbidden and cannot be sanitized in-place")}}else if(o instanceof k)a=qi(""),b=a.ownerDocument.importNode(o,!0),b.nodeType===Fe.element&&b.nodeName==="BODY"||b.nodeName==="HTML"?a=b:a.appendChild(b);else{if(!Ce&&!De&&!ge&&o.indexOf("<")===-1)return A&&Mt?A.createHTML(o):o;if(a=qi(o),!a)return Ce?null:Mt?ae:""}a&&fo&&be(a.firstChild);let ee=ji(et?o:a);for(;M=ee.nextNode();)Zi(M),Xi(M),M.content instanceof u&&fa(M.content);if(et)return o;if(Ce){if(Lt)for(h=wt.call(a.ownerDocument);a.firstChild;)h.appendChild(a.firstChild);else h=a;return(L.shadowroot||L.shadowrootmode)&&(h=X.call(n,h,!0)),h}let Y=ge?a.outerHTML:a.innerHTML;return ge&&E["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&N(Do,a.ownerDocument.doctype.name)&&(Y=""+Y),De&&ot([U,Ie,Le],G=>{Y=Ve(Y,G," ")}),A&&Mt?A.createHTML(Y):Y},t.setConfig=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_o(o),po=!0},t.clearConfig=function(){Pe=null,po=!1},t.isValidAttribute=function(o,r,a){Pe||_o({});let b=S(o),M=S(r);return Ki(b,M,a)},t.addHook=function(o,r){typeof r=="function"&&Be(_[o],r)},t.removeHook=function(o,r){if(r!==void 0){let a=an(_[o],r);return a===-1?void 0:rn(_[o],a,1)[0]}return ko(_[o])},t.removeHooks=function(o){_[o]=[]},t.removeAllHooks=function(){_=Ro()},t}f(Gt,"createDOMPurify");var Oo=Gt();let Ue=!1;window.trustedTypes&&window.trustedTypes.createPolicy&&Oo&&(Ue=window.trustedTypes.createPolicy("GoodTubePolicy",{createHTML:e=>Oo.sanitize(e,{RETURN_TRUSTED_TYPE:!0})}));function No(){let e={};if(document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g,function(){function t(i){return decodeURIComponent(i.split("+").join(" "))}e[t(arguments[1])]=t(arguments[2])}),z()&&typeof e.v>"u"){let t="";window.location.href.indexOf("/watch/")!==-1?t="/watch/":t="/live/";let i=window.location.href.split(t);if(i.length===2){let n=i[1].split("?");e.v=n[n.length-1]}}return e}function p(e,t,i=399){e=e+"_new",document.cookie=e+"="+encodeURIComponent(t)+";SameSite=Lax;path=/;max-age="+i*24*60*60}function P(e){e=e+"_new";let t=document.cookie.split(";");for(let i=0;i .pivot-shorts),
ytd-rich-section-renderer,
grid-shelf-view-model {
display: none !important;
}
- `,console.log("[GoodTube] Shorts removed")),Xe==="true"&&(e+=`
+ `,console.log("[GoodTube] Shorts removed")),dt==="true"&&(e+=`
/* Hide suggested videos */
ytd-watch-flexy #secondary #related {
display: none !important;
@@ -96,17 +96,17 @@
ytd-watch-flexy #secondary:not(:has(ytd-playlist-panel-video-renderer)) {
display: none !important;
}
- `,console.log("[GoodTube] Suggested videos removed")),$e==="true"&&(e+=`
+ `,console.log("[GoodTube] Suggested videos removed")),lt==="true"&&(e+=`
ytd-item-section-renderer.ytd-comments,
#comments-button,
#shorts-panel-container ytd-engagement-panel-section-list-renderer {
display: none !important;
}
- `,console.log("[GoodTube] Comments removed")),et==="true"&&(e+=`
+ `,console.log("[GoodTube] Comments removed")),st==="true"&&(e+=`
ytd-expandable-metadata-renderer[has-video-summary] {
display: none !important;
}
- `,console.log("[GoodTube] AI summaries removed"));let t=document.createElement("style");t.textContent=e,document.head.appendChild(t)}function ga(){if(be==="true")return;window.location.href.indexOf("/shorts")!==-1&&!Mo&&(window.location.href="https://youtube.com",Mo=!0),document.querySelectorAll("a:not(.goodTube_hidden)").forEach(i=>{i.href.indexOf("shorts/")!==-1&&(J(i),J(i.closest("ytd-video-renderer")),J(i.closest("ytd-compact-video-renderer")),J(i.closest("ytd-rich-grid-media")))}),document.querySelectorAll("yt-chip-cloud-chip-renderer:not(.goodTube_hidden):not(.goodTube_checked), yt-tab-shape:not(.goodTube_hidden):not(.goodTube_checked), ytd-guide-entry-renderer:not(.goodTube_checked)").forEach(i=>{i.innerHTML.toLowerCase().indexOf("shorts")!==-1&&J(i),i.classList.add("goodTube_checked")})}function ba(){document.querySelectorAll("#description a, ytd-comments .yt-core-attributed-string a, ytm-expandable-video-description-body-renderer a, .comment-content a").forEach(t=>{!t.classList.contains("goodTube_timestampLink")&&t.getAttribute("href")&&t.getAttribute("href").indexOf(T.v)!==-1&&(t.classList.add("goodTube_timestampLink"),t.addEventListener("click",function(){let i=0,a=t.getAttribute("href").split("t=");typeof a[1]<"u"&&(i=parseFloat(a[1].replace("s",""))),Vo(i)}))})}let ot=setTimeout(()=>{},0);function zt(){if(be==="true"&&window.location.href.indexOf("/shorts")!==-1||!F()){clearTimeout(ot),ot=setTimeout(zt,100);return}document.querySelectorAll("video").forEach(t=>{y?!t.paused&&!t.closest("#movie_player")&&(t.muted=!0,t.volume=0,t.pause()):!t.paused&&(!Bt||!t.closest("#movie_player"))&&(t.muted=!0,t.volume=0,!Ot()||!t.closest("#movie_player")?(t.pause(),t.playbackRate=ye):(t.play(),t.playbackRate=2))}),clearTimeout(ot),ot=setTimeout(zt,100)}function ya(){if(Do)return;let e=document.querySelector("#movie_player .ytp-autonav-toggle-button");e&&(e.getAttribute("aria-checked")==="true"&&q(e),Do=!0)}function _a(){document.querySelectorAll("yt-confirm-dialog-renderer").forEach(t=>{if(t.innerHTML.indexOf("Video paused. Continue watching?")!==-1){let i=t.querySelector("#confirm-button");i&&q(i)}})}function ha(e,t){if(!e||!t)return;let i=document.querySelector("ytd-watch-flexy");i&&F()&&!y&&(i.style.setProperty("--ytd-watch-flexy-width-ratio",e),i.style.setProperty("--ytd-watch-flexy-height-ratio",t))}function Ta(){let e=document.querySelector("ytd-watch-flexy");e&&(e.style.removeProperty("--ytd-watch-flexy-width-ratio"),e.style.removeProperty("--ytd-watch-flexy-height-ratio"))}let No=setTimeout(()=>{},0);function Oo(){d=document.getElementById("movie_player");let e=!1;if(d&&typeof d.getVideoData=="function"&&(e=d.getVideoData()),!e){clearTimeout(No),No=setTimeout(Oo,100);return}let t="transparent";tt==="true"&&(t="#000000");let i=document.createElement("style");i.textContent=`
+ `,console.log("[GoodTube] AI summaries removed")),qe==="true"&&console.log("[GoodTube] Members only videos removed"),W!=="default"&&(Ho(W),console.log("[GoodTube] Videos per row on the home page set to "+W));let t=document.createElement("style");t.textContent=e,document.head.appendChild(t)}let Uo=setTimeout(()=>{},0);function Ho(e){let t=window.location.href;if(t=t.replace("https://","").replace("http://",""),t.split("/").length<=2){let n=document.querySelector("ytd-rich-grid-renderer #contents");if(!n){clearTimeout(Uo),Uo=setTimeout(()=>{Ho(e)},100);return}n.style.setProperty("--ytd-rich-grid-items-per-row",e),n.style.setProperty("--ytd-rich-grid-posts-per-row",e),n.style.setProperty("--ytd-rich-grid-slim-items-per-row",e),n.style.setProperty("--ytd-rich-grid-game-cards-per-row",e),n.style.setProperty("--ytd-rich-grid-mini-game-cards-per-row",e)}}function wn(){document.querySelectorAll("ytd-rich-item-renderer:not(.goodTube_checked)").forEach(t=>{t.innerHTML.toLowerCase().indexOf("members only")!==-1&&j(t),t.classList.add("goodTube_checked")})}function An(){if(he==="true")return;window.location.href.indexOf("/shorts")!==-1&&!Vo&&(window.location.href="https://youtube.com",Vo=!0),document.querySelectorAll("a:not(.goodTube_hidden)").forEach(i=>{i.href.indexOf("shorts/")!==-1&&(j(i),j(i.closest("ytd-video-renderer")),j(i.closest("ytd-compact-video-renderer")),j(i.closest("ytd-rich-grid-media")))}),document.querySelectorAll("yt-chip-cloud-chip-renderer:not(.goodTube_hidden):not(.goodTube_checked), yt-tab-shape:not(.goodTube_hidden):not(.goodTube_checked), ytd-guide-entry-renderer:not(.goodTube_checked)").forEach(i=>{i.innerHTML.toLowerCase().indexOf("shorts")!==-1&&j(i),i.classList.add("goodTube_checked")})}function En(){document.querySelectorAll("#description a, ytd-comments .yt-core-attributed-string a, ytm-expandable-video-description-body-renderer a, .comment-content a").forEach(t=>{!t.classList.contains("goodTube_timestampLink")&&t.getAttribute("href")&&t.getAttribute("href").indexOf(T.v)!==-1&&(t.classList.add("goodTube_timestampLink"),t.addEventListener("click",function(){let i=0,n=t.getAttribute("href").split("t=");typeof n[1]<"u"&&(i=parseFloat(n[1].replace("s",""))),jo(i)}))})}let ct=setTimeout(()=>{},0);function Zt(){if(he==="true"&&window.location.href.indexOf("/shorts")!==-1||!z()){clearTimeout(ct),ct=setTimeout(Zt,100);return}document.querySelectorAll("video").forEach(t=>{y?!t.paused&&!t.closest("#movie_player")&&(t.muted=!0,t.volume=0,t.pause()):!t.paused&&(!qt||!t.closest("#movie_player"))&&(t.muted=!0,t.volume=0,!Qt()||!t.closest("#movie_player")?(t.pause(),t.playbackRate=Te):(t.play(),t.playbackRate=2))}),clearTimeout(ct),ct=setTimeout(Zt,100)}function Sn(){if(Bo)return;let e=document.querySelector("#movie_player .ytp-autonav-toggle-button");e&&(e.getAttribute("aria-checked")==="true"&&q(e),Bo=!0)}function In(){document.querySelectorAll("yt-confirm-dialog-renderer").forEach(t=>{if(t.innerHTML.indexOf("Video paused. Continue watching?")!==-1){let i=t.querySelector("#confirm-button");i&&q(i)}})}function Ln(e,t){if(!e||!t)return;let i=document.querySelector("ytd-watch-flexy");i&&z()&&!y&&(i.style.setProperty("--ytd-watch-flexy-width-ratio",e),i.style.setProperty("--ytd-watch-flexy-height-ratio",t))}function Mn(){let e=document.querySelector("ytd-watch-flexy");e&&(e.style.removeProperty("--ytd-watch-flexy-width-ratio"),e.style.removeProperty("--ytd-watch-flexy-height-ratio"))}let Yo=setTimeout(()=>{},0);function Go(){d=document.getElementById("movie_player");let e=!1;if(d&&typeof d.getVideoData=="function"&&(e=d.getVideoData()),!e){clearTimeout(Yo),Yo=setTimeout(Go,100);return}let t="transparent";ut==="true"&&(t="#000000");let i=document.createElement("style");i.textContent=`
/* Player wrapper */
#goodTube_playerWrapper {
border-radius: 12px;
@@ -134,7 +134,7 @@
max-width: calc(177.77777778vh - var(--ytd-watch-flexy-masthead-height) * 1.7777777778 - var(--ytd-margin-6x) * 1.7777777778 - var(--ytd-watch-flexy-space-below-player) * 1.7777777778) !important;
min-width: calc(var(--ytd-watch-flexy-min-player-height) * 1.7777777778) !important;
}
- `,document.head.appendChild(i);let a=document.createElement("div");a.id="goodTube_playerWrapper",a.classList.add("goodTube_hidden"),document.body.appendChild(a);let l=document.createElement("iframe");l.src="https://en.wikipedia.org/wiki/Fuck?goodTubeProxy=1",l.setAttribute("width","100%"),l.setAttribute("height","100%"),l.setAttribute("frameborder","0"),l.setAttribute("scrolling","yes"),l.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"),l.setAttribute("referrerpolicy","strict-origin-when-cross-origin"),l.setAttribute("allowfullscreen",!0),l.style.display="none",a.appendChild(l),ne=a,P=l,jo(),setInterval(jo,100)}let Ft=!1;function xa(){if(y)Ft||(at(!0),Ft=!0);else{Ft=!1;let e=document.querySelector("#player.ytd-watch-flexy");if((!e||e.offsetHeight<=0)&&(e=document.querySelector("#ytd-player")),(!e||e.offsetHeight<=0)&&(e=document.querySelector(".player-size")),(!e||e.offsetHeight<=0)&&(e=document.querySelector(".html5-video-player")),e&&e.offsetHeight>0){let t=e.getBoundingClientRect();ne.style.top=t.top+window.scrollY+"px",ne.style.left=t.left+window.scrollX+"px",ne.style.width=e.offsetWidth+"px",ne.style.height=e.offsetHeight+"px",Ke(ne)}}}let _e=setTimeout(()=>{},0);function He(){d=document.getElementById("movie_player");let e=!1,t=!1;if(d&&typeof d.getVideoData=="function"&&(e=d.getVideoData(),t=e.video_id),!e||t!==T.v){clearTimeout(_e),_e=setTimeout(He,100);return}if(d&&typeof d.getPlaylist=="function"&&typeof d.getPlaylistIndex=="function"){if(ee=d.getPlaylist(),Ve=d.getPlaylistIndex(),!ee){clearTimeout(_e),_e=setTimeout(He,100);return}}else{clearTimeout(_e),_e=setTimeout(He,100);return}}let Bo=setTimeout(()=>{},0);function Po(){if(re="",va(),!Ro){clearTimeout(Bo),Bo=setTimeout(Po,100);return}let e=0;Ue==="false"&&typeof T.t<"u"&&(e=parseFloat(T.t.replace("s","")));let t="false";if(typeof T.i<"u"||typeof T.index<"u"||typeof T.list<"u"?(t="true",He()):(ee=!1,Ve=0),Co){F()||at();let i="";e>0&&(i="&start="+e),P.contentWindow.postMessage("goodTube_src_https://www.youtube.com/embed/"+T.v+"?goodTubeEmbed=1&autoplay=1&goodTube_playlist="+t+"&goodTube_autoplay="+W+"&goodTube_playbackSpeed="+ye+"&goodTube_hideInfoCards="+ze+"&goodTube_hideEndScreen="+Fe+i,"*"),Co=!1}else P.contentWindow.postMessage("goodTube_load_"+T.v+"|||"+e+"|||"+t,"*");Ue==="false"&&Ut(),rt()}let it=setTimeout(()=>{},0);function Ut(){if(!Pt){clearTimeout(it),it=setTimeout(Ut,100);return}d=document.getElementById("movie_player");let e=!1,t=!1;if(d&&typeof d.getVideoData=="function"&&typeof d.getCurrentTime=="function"&&(e=d.getVideoData(),t=e.video_id),!e||!t||t!==T.v){clearTimeout(it),it=setTimeout(Ut,100);return}let i=Math.floor(d.getCurrentTime());i>=10&&Vo(i,t)}function at(e=!1){Pe||(e?(d=document.getElementById("movie_player"),d&&typeof d.stopVideo=="function"&&d.stopVideo()):P.contentWindow.postMessage("goodTube_stopVideo","*")),J(ne)}function Vo(e,t=""){P.contentWindow.postMessage("goodTube_skipTo_"+e+"|||"+t,"*")}function va(){P.contentWindow.postMessage("goodTube_pause","*")}let nt=setTimeout(()=>{},0);function rt(){if(!Vt||!Pt){clearTimeout(nt),nt=setTimeout(rt,100);return}if(!y)P.contentWindow.postMessage("goodTube_play|||"+T.v,"*");else{d=document.getElementById("movie_player");let e=!1;if(d&&typeof d.getVideoData=="function"&&(e=d.getVideoData()),!e||T.v!==e.video_id){clearTimeout(nt),nt=setTimeout(rt,100);return}let t=document.querySelector("#movie_player video");if(t&&t.currentTime>=t.duration)return;d&&typeof d.playVideo=="function"&&setTimeout(()=>{d.playVideo()},100)}}function ka(){document.addEventListener("keydown",zo,!0),document.addEventListener("keyup",zo,!0)}function zo(e){if(!F()||y)return;let t=[{key:">",code:!1,ctrl:!1,shift:!0,alt:!1},{key:"<",code:!1,ctrl:!1,shift:!0,alt:!1},{key:",",code:!1,ctrl:!1,shift:!1,alt:!1},{key:".",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"arrowleft",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"arrowright",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"j",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"l",code:!1,ctrl:!1,shift:!1,alt:!1},{key:" ",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"k",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"mediaplaypause",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"m",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"f",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"c",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"o",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"w",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"=",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"-",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"w",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"a",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"s",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"d",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"[",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"]",code:!1,ctrl:!1,shift:!1,alt:!1},{key:!1,code:"numpadadd",ctrl:!1,shift:!1,alt:!1},{key:!1,code:"numpadsubtract",ctrl:!1,shift:!1,alt:!1},{key:"0",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"1",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"2",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"3",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"4",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"5",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"6",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"7",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"8",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"9",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"i",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"arrowleft",code:!1,ctrl:!0,shift:!1,alt:!1},{key:"arrowright",code:!1,ctrl:!0,shift:!1,alt:!1}],i=e.key.toLowerCase(),a=e.code.toLowerCase(),l=e.ctrlKey;e.metaKey&&(l=e.metaKey);let u=e.shiftKey,m=e.altKey,k=!1;if(t.forEach(x=>{(i===x.key||a===x.code)&&l===x.ctrl&&u===x.shift&&m===x.alt&&(k=!0)}),k){let x=e.srcElement,w=!1,oe=!1;if(x&&(typeof x.nodeName<"u"&&(w=x.nodeName.toLowerCase()),typeof x.getAttribute<"u"&&(oe=x.getAttribute("id"))),!x||w.indexOf("input")===-1&&w.indexOf("label")===-1&&w.indexOf("select")===-1&&w.indexOf("textarea")===-1&&w.indexOf("fieldset")===-1&&w.indexOf("legend")===-1&&w.indexOf("datalist")===-1&&w.indexOf("output")===-1&&w.indexOf("option")===-1&&w.indexOf("optgroup")===-1&&oe!=="contenteditable-root"){e.preventDefault(),e.stopImmediatePropagation();let ie=e.key,C=e.keyCode;i==="mediaplaypause"&&(ie=" ",C=32),P.contentWindow.postMessage("goodTube_shortcut_"+e.type+"_"+ie+"_"+C+"_"+e.ctrlKey+"_"+e.metaKey+"_"+e.shiftKey+"_"+e.altKey,"*")}}}function Ht(e=!1){d=document.getElementById("movie_player"),d&&typeof d.nextVideo=="function"&&d.nextVideo(),console.log("[GoodTube] Playing next video...")}function wa(){d=document.getElementById("movie_player"),d&&typeof d.previousVideo=="function"&&d.previousVideo(),console.log("[GoodTube] Playing previous video...")}let Fo=setTimeout(()=>{},0);function Uo(){if(W==="true")Ht();else if(ee){if(He(),!ee||!Ve){clearTimeout(Fo),Fo=setTimeout(Uo,100);return}Ve{},0);function Go(e=!1){e||(window.top===window.self&&(console.log(`
+ `,document.head.appendChild(i);let n=document.createElement("div");n.id="goodTube_playerWrapper",n.classList.add("goodTube_hidden"),document.body.appendChild(n);let l=document.createElement("iframe");l.src="https://wikipedia.org/wiki/Bruce_Lee?goodTubeProxy=1",l.setAttribute("width","100%"),l.setAttribute("height","100%"),l.setAttribute("frameborder","0"),l.setAttribute("scrolling","yes"),l.setAttribute("allow","accelerometer *; autoplay *; clipboard-write *; encrypted-media *; gyroscope *; picture-in-picture *; web-share *;"),l.setAttribute("referrerpolicy","strict-origin-when-cross-origin"),l.setAttribute("allowfullscreen",!0),l.style.display="none",n.appendChild(l),re=n,B=l,ti(),setInterval(ti,100)}let Kt=!1;function Dn(){if(y)Kt||(ft(!0),Kt=!0);else{Kt=!1;let e=document.querySelector("#player.ytd-watch-flexy");if((!e||e.offsetHeight<=0)&&(e=document.querySelector("#ytd-player")),(!e||e.offsetHeight<=0)&&(e=document.querySelector(".player-size")),(!e||e.offsetHeight<=0)&&(e=document.querySelector(".html5-video-player")),e&&e.offsetHeight>0){let t=e.getBoundingClientRect();re.style.top=t.top+window.scrollY+"px",re.style.left=t.left+window.scrollX+"px",re.style.width=e.offsetWidth+"px",re.style.height=e.offsetHeight+"px",at(re)}}}let xe=setTimeout(()=>{},0);function We(){d=document.getElementById("movie_player");let e=!1,t=!1;if(d&&typeof d.getVideoData=="function"&&(e=d.getVideoData(),t=e.video_id),!e||t!==T.v){clearTimeout(xe),xe=setTimeout(We,100);return}if(d&&typeof d.getPlaylist=="function"&&typeof d.getPlaylistIndex=="function"){if(te=d.getPlaylist(),Ye=d.getPlaylistIndex(),!te){clearTimeout(xe),xe=setTimeout(We,100);return}}else{clearTimeout(xe),xe=setTimeout(We,100);return}}let Qo=setTimeout(()=>{},0);function qo(){if(de="",Cn(),!Fo){clearTimeout(Qo),Qo=setTimeout(qo,100);return}let e=0;je==="false"&&typeof T.t<"u"&&(e=parseFloat(T.t.replace("s","")));let t="false";if(typeof T.i<"u"||typeof T.index<"u"||typeof T.list<"u"?(t="true",We()):(te=!1,Ye=0),zo){z()||ft();let i="";e>0&&(i="&start="+e),B.contentWindow.postMessage("goodTube_src_https://www.youtube.com/embed/"+T.v+"?goodTubeEmbed=1&autoplay=1&goodTube_playlist="+t+"&goodTube_autoplay="+Z+"&goodTube_playbackSpeed="+Te+"&goodTube_hideInfoCards="+Ge+"&goodTube_hideEndScreen="+Qe+i,"*"),zo=!1}else B.contentWindow.postMessage("goodTube_load_"+T.v+"|||"+e+"|||"+t,"*");je==="false"&&Jt(),gt()}let pt=setTimeout(()=>{},0);function Jt(){if(!jt){clearTimeout(pt),pt=setTimeout(Jt,100);return}d=document.getElementById("movie_player");let e=!1,t=!1;if(d&&typeof d.getVideoData=="function"&&typeof d.getCurrentTime=="function"&&(e=d.getVideoData(),t=e.video_id),!e||!t||t!==T.v){clearTimeout(pt),pt=setTimeout(Jt,100);return}let i=Math.floor(d.getCurrentTime());i>=10&&jo(i,t)}function ft(e=!1){He||(e?(d=document.getElementById("movie_player"),d&&typeof d.pauseVideo=="function"&&typeof d.mute=="function"&&(d.pauseVideo(),d.mute())):B.contentWindow.postMessage("goodTube_stopVideo","*")),j(re)}function jo(e,t=""){B.contentWindow.postMessage("goodTube_skipTo_"+e+"|||"+t,"*")}function Cn(){B.contentWindow.postMessage("goodTube_pause","*")}let mt=setTimeout(()=>{},0);function gt(){if(!Wt||!jt){clearTimeout(mt),mt=setTimeout(gt,100);return}if(!y)B.contentWindow.postMessage("goodTube_play|||"+T.v,"*");else{d=document.getElementById("movie_player");let e=!1;if(d&&typeof d.getVideoData=="function"&&(e=d.getVideoData()),!e||T.v!==e.video_id){clearTimeout(mt),mt=setTimeout(gt,100);return}let t=document.querySelector("#movie_player video");if(t&&t.currentTime>=t.duration)return;d&&typeof d.playVideo=="function"&&setTimeout(()=>{d.playVideo()},100)}}function Rn(){document.addEventListener("keydown",Wo,!0),document.addEventListener("keyup",Wo,!0)}function Wo(e){if(!z()||y)return;let t=[{key:">",code:!1,ctrl:!1,shift:!0,alt:!1},{key:"<",code:!1,ctrl:!1,shift:!0,alt:!1},{key:",",code:!1,ctrl:!1,shift:!1,alt:!1},{key:".",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"arrowleft",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"arrowright",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"j",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"l",code:!1,ctrl:!1,shift:!1,alt:!1},{key:" ",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"k",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"mediaplaypause",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"m",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"f",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"c",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"o",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"w",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"=",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"-",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"w",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"a",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"s",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"d",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"[",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"]",code:!1,ctrl:!1,shift:!1,alt:!1},{key:!1,code:"numpadadd",ctrl:!1,shift:!1,alt:!1},{key:!1,code:"numpadsubtract",ctrl:!1,shift:!1,alt:!1},{key:"0",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"1",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"2",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"3",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"4",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"5",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"6",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"7",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"8",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"9",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"i",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"arrowleft",code:!1,ctrl:!0,shift:!1,alt:!1},{key:"arrowright",code:!1,ctrl:!0,shift:!1,alt:!1}],i=e.key.toLowerCase(),n=e.code.toLowerCase(),l=e.ctrlKey;e.metaKey&&(l=e.metaKey);let u=e.shiftKey,m=e.altKey,k=!1;if(t.forEach(x=>{(i===x.key||n===x.code)&&l===x.ctrl&&u===x.shift&&m===x.alt&&(k=!0)}),k){let x=e.srcElement,w=!1,ie=!1;if(x&&(typeof x.nodeName<"u"&&(w=x.nodeName.toLowerCase()),typeof x.getAttribute<"u"&&(ie=x.getAttribute("id"))),!x||w.indexOf("input")===-1&&w.indexOf("label")===-1&&w.indexOf("select")===-1&&w.indexOf("textarea")===-1&&w.indexOf("fieldset")===-1&&w.indexOf("legend")===-1&&w.indexOf("datalist")===-1&&w.indexOf("output")===-1&&w.indexOf("option")===-1&&w.indexOf("optgroup")===-1&&ie!=="contenteditable-root"){e.preventDefault(),e.stopImmediatePropagation();let pe=e.key,fe=e.keyCode;i==="mediaplaypause"&&(pe=" ",fe=32),B.contentWindow.postMessage("goodTube_shortcut_"+e.type+"_"+pe+"_"+fe+"_"+e.ctrlKey+"_"+e.metaKey+"_"+e.shiftKey+"_"+e.altKey,"*")}}}function Xt(e=!1){d=document.getElementById("movie_player"),d&&typeof d.nextVideo=="function"&&d.nextVideo(),console.log("[GoodTube] Playing next video...")}function On(){d=document.getElementById("movie_player"),d&&typeof d.previousVideo=="function"&&d.previousVideo(),console.log("[GoodTube] Playing previous video...")}let Zo=setTimeout(()=>{},0);function Ko(){if(Z==="true")Xt();else if(te){if(We(),!te||!Ye){clearTimeout(Zo),Zo=setTimeout(Ko,100);return}Ye{},0);function $o(e=!1){e||(window.top===window.self&&(console.log(`
==================================================
______ ________ __
/ ____/___ ____ ____/ /_ __/_ __/ /_ ___
@@ -142,7 +142,7 @@
/ /_/ / /_/ / /_/ / /_/ / / / / /_/ / /_/ / __/
\\____/\\____/\\____/\\____/ /_/ \\____/_____/\\___/
-==================================================`),console.log("[GoodTube] Initiating...")),window.addEventListener("message",Qo),zt(),document.addEventListener("DOMContentLoaded",Yt),(document.readyState==="interactive"||document.readyState==="complete")&&Yt()),!document.body||!document.head?(clearTimeout(Yo),Yo=setTimeout(()=>{Go(!0)},1)):Yt()}function Yt(){Ho||(Ho=!0,La(),pa(),ma(),Oo(),Da(),Ea(),ka(),Ia())}let dt=setTimeout(()=>{},0);function Qo(e){if(typeof e.data=="string"){if(!document.body||!document.head?(clearTimeout(dt),dt=setTimeout(()=>{Qo(e)},100)):e.data==="goodTube_proxyIframe_loaded"?Ro=!0:e.data==="goodTube_playerIframe_loaded"&&(Pt=!0,P.style.display="block"),e.data.indexOf("goodTube_pip_")!==-1)e.data.replace("goodTube_pip_","")==="true"?Pe=!0:(Pe=!1,typeof T.v>"u"&&at());else if(e.data.indexOf("goodTube_playbackSpeed_")!==-1)p("goodTube_playbackSpeed",e.data.replace("goodTube_playbackSpeed_","")),ye=e.data.replace("goodTube_playbackSpeed_","");else if(e.data==="goodTube_prevVideo")wa();else if(e.data==="goodTube_nextVideo")Ht();else if(e.data==="goodTube_videoEnded")Uo();else if(e.data==="goodTube_theater"&&!document.fullscreenElement){let t=document.querySelector(".ytp-size-button");t&&q(t)}else if(e.data==="goodTube_autoplay_false")p("goodTube_autoplay","false"),W="false";else if(e.data==="goodTube_autoplay_true")p("goodTube_autoplay","true"),W="true";else if(e.data.indexOf("goodTube_syncMainPlayer_")!==-1&&F()&&!y){let t=parseFloat(e.data.replace("goodTube_syncMainPlayer_","")),i=document.querySelector("#movie_player video");if(d=document.getElementById("movie_player"),!d||typeof d.seekTo!="function"||typeof d.playVideo!="function"||typeof d.mute!="function"||typeof d.setVolume!="function")return;i&&Math.floor(i.currentTime)!==Math.floor(t)&&!Ot()&&(Bt=!0,d.playVideo(),d.seekTo(t-.5),d.mute(),d.setVolume(0),i.volume=0,i.muted=!0,clearTimeout(dt),dt=setTimeout(()=>{Bt=!1},1e3))}else if(e.data==="goodTube_fallback_enable")y=!0,document.body&&!document.body.classList.contains("goodTube_fallback")&&document.body.classList.add("goodTube_fallback"),Ta(),Ko(),rt(),document.fullscreenElement&&(document.exitFullscreen(),window.setTimeout(()=>{let t=document.querySelector(".ytp-fullscreen-button");t&&q(t)},100));else if(e.data==="goodTube_fallback_disable")y=!1,document.body&&document.body.classList.contains("goodTube_fallback")&&document.body.classList.remove("goodTube_fallback"),document.fullscreenElement&&(document.exitFullscreen(),window.setTimeout(()=>{P.contentWindow.postMessage("goodTube_fullscreen","*")},100));else if(e.data.indexOf("goodTube_syncAspectRatio_")!==-1){let t=e.data.replace("goodTube_syncAspectRatio_","").split("_");ha(t[0],t[1])}}}function jo(){let e=Lo;e&&(e=e.split("#")[0],e=e.split("index=")[0]);let t=window.location.href;t&&(t=t.split("#")[0],t=t.split("index=")[0]),e!==t&&(T=Io(),F()?(Po(),Sa()):at(),Lo=window.location.href),F()&&(Aa(),ba(),y||ya(),_a(),xa(),Ma()),ga()}function Ia(){let e=document.createElement("div");document.body.appendChild(e);let t=" checked";be==="true"&&(t="");let i="";ze==="true"&&(i=" checked");let a="";Fe==="true"&&(a=" checked");let l="";Xe==="true"&&(l=" checked");let u="";$e==="true"&&(u=" checked");let m="";et==="true"&&(m=" checked");let k="";Ue==="true"&&(k=" checked");let x="";tt==="true"&&(x=" checked"),Je(e,`
+==================================================`),console.log("[GoodTube] Initiating...")),window.addEventListener("message",ei),Zt(),document.addEventListener("DOMContentLoaded",$t),(document.readyState==="interactive"||document.readyState==="complete")&&$t()),!document.body||!document.head?(clearTimeout(Xo),Xo=setTimeout(()=>{$o(!0)},1)):$t()}function $t(){Jo||(Jo=!0,zn(),xn(),kn(),Go(),Fn(),Pn(),Rn(),Vn())}let bt=setTimeout(()=>{},0);function ei(e){if(typeof e.data=="string"){if(!document.body||!document.head?(clearTimeout(bt),bt=setTimeout(()=>{ei(e)},100)):e.data==="goodTube_proxyIframe_loaded"?Fo=!0:e.data==="goodTube_playerIframe_loaded"&&(jt=!0,B.style.display="block"),e.data.indexOf("goodTube_pip_")!==-1)e.data.replace("goodTube_pip_","")==="true"?He=!0:(He=!1,typeof T.v>"u"&&ft());else if(e.data.indexOf("goodTube_playbackSpeed_")!==-1)p("goodTube_playbackSpeed",e.data.replace("goodTube_playbackSpeed_","")),Te=e.data.replace("goodTube_playbackSpeed_","");else if(e.data==="goodTube_prevVideo")On();else if(e.data==="goodTube_nextVideo")Xt();else if(e.data==="goodTube_videoEnded")Ko();else if(e.data==="goodTube_theater"&&!document.fullscreenElement){let t=document.querySelector(".ytp-size-button");t&&q(t)}else if(e.data==="goodTube_autoplay_false")p("goodTube_autoplay","false"),Z="false";else if(e.data==="goodTube_autoplay_true")p("goodTube_autoplay","true"),Z="true";else if(e.data.indexOf("goodTube_syncMainPlayer_")!==-1&&z()&&!y){let t=parseFloat(e.data.replace("goodTube_syncMainPlayer_","")),i=document.querySelector("#movie_player video");if(d=document.getElementById("movie_player"),!d||typeof d.seekTo!="function"||typeof d.playVideo!="function"||typeof d.mute!="function"||typeof d.setVolume!="function")return;i&&Math.floor(i.currentTime)!==Math.floor(t)&&!Qt()&&(qt=!0,d.playVideo(),d.seekTo(t-.5),d.mute(),d.setVolume(0),i.volume=0,i.muted=!0,clearTimeout(bt),bt=setTimeout(()=>{qt=!1},1e3))}else if(e.data==="goodTube_fallback_enable")y=!0,document.body&&!document.body.classList.contains("goodTube_fallback")&&document.body.classList.add("goodTube_fallback"),Mn(),ai(),gt(),document.fullscreenElement&&(document.exitFullscreen(),window.setTimeout(()=>{let t=document.querySelector(".ytp-fullscreen-button");t&&q(t)},100));else if(e.data==="goodTube_fallback_disable")y=!1,document.body&&document.body.classList.contains("goodTube_fallback")&&document.body.classList.remove("goodTube_fallback"),document.fullscreenElement&&(document.exitFullscreen(),window.setTimeout(()=>{B.contentWindow.postMessage("goodTube_fullscreen","*")},100));else if(e.data.indexOf("goodTube_syncAspectRatio_")!==-1){let t=e.data.replace("goodTube_syncAspectRatio_","").split("_");Ln(t[0],t[1])}}}function ti(){let e=Po;e&&(e=e.split("#")[0],e=e.split("index=")[0]);let t=window.location.href;t&&(t=t.split("#")[0],t=t.split("index=")[0]),e!==t&&(T=No(),z()?(qo(),Bn()):ft(),Po=window.location.href),z()&&(Nn(),En(),y||Sn(),In(),Dn(),Un()),An(),qe==="true"&&wn()}function Vn(){let e=document.createElement("div");document.body.appendChild(e);let t=" checked";he==="true"&&(t="");let i="";Ge==="true"&&(i=" checked");let n="";Qe==="true"&&(n=" checked");let l="";dt==="true"&&(l=" checked");let u="";lt==="true"&&(u=" checked");let m="";st==="true"&&(m=" checked");let k="";qe==="true"&&(k=" checked");let x="";je==="true"&&(x=" checked");let w="";ut==="true"&&(w=" checked");let ie="",pe="",fe="",me="",ne="",vt="";ie==="default"?ie=" selected":W==="2"?pe=" selected":W==="3"?fe=" selected":W==="4"?me=" selected":W==="5"?ne=" selected":W==="6"&&(vt=" selected"),rt(e,`
-
+
Hide end screen suggested videos
@@ -193,15 +193,32 @@