mirror of
https://github.com/goodtube4u/goodtube.git
synced 2025-11-22 10:16:11 +00:00
902 lines
97 KiB
JavaScript
902 lines
97 KiB
JavaScript
(()=>{(function(){"use strict";var tn=Object.defineProperty,f=(e,t)=>tn(e,"name",{value:t,configurable:!0}),{entries:xo,setPrototypeOf:vo,isFrozen:on,getPrototypeOf:nn,getOwnPropertyDescriptor:an}=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;l<i;l++)n[l-2]=arguments[l];return e.apply(t,n)},"apply")),Bt||(Bt=f(function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return new e(...i)},"construct"));var it=C(Array.prototype.forEach),rn=C(Array.prototype.lastIndexOf),wo=C(Array.prototype.pop),Be=C(Array.prototype.push),dn=C(Array.prototype.splice),nt=C(String.prototype.toLowerCase),Vt=C(String.prototype.toString),zt=C(String.prototype.match),Ve=C(String.prototype.replace),ln=C(String.prototype.indexOf),sn=C(String.prototype.trim),H=C(Object.prototype.hasOwnProperty),N=C(RegExp.prototype.test),ze=ko(TypeError);function C(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var i=arguments.length,n=new Array(i>1?i-1:0),l=1;l<i;l++)n[l-1]=arguments[l];return Pt(e,t,n)}}f(C,"unapply");function ko(e){return function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return Bt(e,i)}}f(ko,"unconstruct");function c(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nt;vo&&vo(e,null);let n=t.length;for(;n--;){let l=t[n];if(typeof l=="string"){let u=i(l);u!==l&&(on(t)||(t[n]=u),l=u)}e[l]=!0}return e}f(c,"addToSet");function Ao(e){for(let t=0;t<e.length;t++)H(e,t)||(e[t]=null);return e}f(Ao,"cleanArray");function q(e){let t=Nt(null);for(let[i,n]of xo(e))H(e,i)&&(Array.isArray(n)?t[i]=Ao(n):n&&typeof n=="object"&&n.constructor===Object?t[i]=q(n):t[i]=n);return t}f(q,"clone");function _e(e,t){for(;e!==null;){let n=an(e,t);if(n){if(n.get)return C(n.get);if(typeof n.value=="function")return C(n.value)}e=nn(e)}function i(){return null}return f(i,"fallbackValue"),i}f(_e,"lookupGetter");var Eo=O(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ft=O(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ut=O(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),un=O(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ht=O(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),cn=O(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),So=O(["#text"]),Io=O(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Yt=O(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Mo=O(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),at=O(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),pn=V(/\{\{[\w\W]*|[\w\W]*\}\}/gm),fn=V(/<%[\w\W]*|[\w\W]*%>/gm),mn=V(/\$\{[\w\W]*/gm),gn=V(/^data-[\-\w.\u00B7-\uFFFF]+$/),bn=V(/^aria-[\-\w]+$/),Lo=V(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yn=V(/^(?:\w+script|data):/i),_n=V(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Do=V(/^html$/i),hn=V(/^[a-z][.\w]*(-[.\w]+)+$/i),Co=Object.freeze({__proto__:null,ARIA_ATTR:bn,ATTR_WHITESPACE:_n,CUSTOM_ELEMENT:hn,DATA_ATTR:gn,DOCTYPE_NAME:Do,ERB_EXPR:fn,IS_ALLOWED_URI:Lo,IS_SCRIPT_OR_DATA:yn,MUSTACHE_EXPR:pn,TMPLIT_EXPR:mn}),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},Tn=f(function(){return typeof window>"u"?null:window},"getGlobal"),xn=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]:Tn(),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:w,Element:x,NodeFilter:k,NamedNodeMap:ie=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:pe,DOMParser:fe,trustedTypes:me}=e,ne=x.prototype,vt=_e(ne,"cloneNode"),wt=_e(ne,"remove"),Ke=_e(ne,"nextSibling"),Je=_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:Xe,createDocumentFragment:kt,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:Me,DATA_ATTR:At,ARIA_ATTR:Et,IS_SCRIPT_OR_DATA:St,ATTR_WHITESPACE:$e,CUSTOM_ELEMENT:aa}=Co,{IS_ALLOWED_URI:Ci}=Co,E=null,Ri=c({},[...Eo,...Ft,...Ut,...Ht,...So]),M=null,Oi=c({},[...Io,...Yt,...Mo,...at]),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}})),et=null,uo=null,Le=Object.seal(Nt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ni=!0,co=!0,Pi=!1,Bi=!0,De=!1,It=!0,ge=!1,po=!1,fo=!1,Ce=!1,Mt=!1,Lt=!1,Vi=!0,zi=!1,ra="user-content-",mo=!0,tt=!1,Re={},Oe=null,Fi=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"]),Ui=null,Hi=c({},["audio","video","img","source","image","track"]),go=null,Yi=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"]),ot=null,sa=["application/xhtml+xml","text/html"],ua="text/html",S=null,Pe=null,ca=i.createElement("form"),Gi=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),ot=sa.indexOf(o.PARSER_MEDIA_TYPE)===-1?ua:o.PARSER_MEDIA_TYPE,S=ot==="application/xhtml+xml"?Vt:nt,E=H(o,"ALLOWED_TAGS")?c({},o.ALLOWED_TAGS,S):Ri,M=H(o,"ALLOWED_ATTR")?c({},o.ALLOWED_ATTR,S):Oi,yo=H(o,"ALLOWED_NAMESPACES")?c({},o.ALLOWED_NAMESPACES,Vt):da,go=H(o,"ADD_URI_SAFE_ATTR")?c(q(Yi),o.ADD_URI_SAFE_ATTR,S):Yi,Ui=H(o,"ADD_DATA_URI_TAGS")?c(q(Hi),o.ADD_DATA_URI_TAGS,S):Hi,Oe=H(o,"FORBID_CONTENTS")?c({},o.FORBID_CONTENTS,S):Fi,et=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,Ni=o.ALLOW_ARIA_ATTR!==!1,co=o.ALLOW_DATA_ATTR!==!1,Pi=o.ALLOW_UNKNOWN_PROTOCOLS||!1,Bi=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,Mt=o.RETURN_DOM_FRAGMENT||!1,Lt=o.RETURN_TRUSTED_TYPE||!1,fo=o.FORCE_BODY||!1,Vi=o.SANITIZE_DOM!==!1,zi=o.SANITIZE_NAMED_PROPS||!1,mo=o.KEEP_CONTENT!==!1,tt=o.IN_PLACE||!1,Ci=o.ALLOWED_URI_REGEXP||Lo,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&&Gi(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(v.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&Gi(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),Mt&&(Ce=!0),Re&&(E=c({},So),M=[],Re.html===!0&&(c(E,Eo),c(M,Io)),Re.svg===!0&&(c(E,Ft),c(M,Yt),c(M,at)),Re.svgFilters===!0&&(c(E,Ut),c(M,Yt),c(M,at)),Re.mathMl===!0&&(c(E,Ht),c(M,Mo),c(M,at))),o.ADD_TAGS&&(typeof o.ADD_TAGS=="function"?Le.tagCheck=o.ADD_TAGS:(E===Ri&&(E=q(E)),c(E,o.ADD_TAGS,S))),o.ADD_ATTR&&(typeof o.ADD_ATTR=="function"?Le.attributeCheck=o.ADD_ATTR:(M===Oi&&(M=q(M)),c(M,o.ADD_ATTR,S))),o.ADD_URI_SAFE_ATTR&&c(go,o.ADD_URI_SAFE_ATTR,S),o.FORBID_CONTENTS&&(Oe===Fi&&(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 et.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=xn(me,l)),A!==null&&typeof ae=="string"&&(ae=A.createHTML(""));O&&O(o),Pe=o}},"_parseConfig"),Qi=c({},[...Ft,...Ut,...un]),qi=c({},[...Ht,...cn]),pa=f(function(o){let r=R(o);(!r||!r.tagName)&&(r={namespaceURI:Ne,tagName:"template"});let a=nt(o.tagName),b=nt(r.tagName);return yo[o.namespaceURI]?o.namespaceURI===Ct?r.namespaceURI===$?a==="svg":r.namespaceURI===Dt?a==="svg"&&(b==="annotation-xml"||Rt[b]):!!Qi[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]||!Qi[a]):!!(ot==="application/xhtml+xml"&&yo[o.namespaceURI]):!1},"_checkValidNamespace"),be=f(function(o){Be(t.removed,{element:o});try{R(o).removeChild(o)}catch{wt(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||Mt)try{be(r)}catch{}else try{r.setAttribute(o,"")}catch{}},"_removeAttribute"),ji=f(function(o){let r=null,a=null;if(fo)o="<remove></remove>"+o;else{let h=zt(o,/^[\r\n\t ]+/);a=h&&h[0]}ot==="application/xhtml+xml"&&Ne===$&&(o='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+o+"</body></html>");let b=A?A.createHTML(o):o;if(Ne===$)try{r=new fe().parseFromString(b,ot)}catch{}if(!r||!r.documentElement){r=Se.createDocument(Ne,"template",null);try{r.documentElement.innerHTML=bo?ae:b}catch{}}let L=r.body||r.documentElement;return o&&a&&L.insertBefore(i.createTextNode(a),L.childNodes[0]||null),Ne===$?F.call(r,ge?"html":"body")[0]:ge?r.documentElement:L},"_initDocument"),Wi=f(function(o){return Xe.call(o.ownerDocument||o,o,k.SHOW_ELEMENT|k.SHOW_COMMENT|k.SHOW_TEXT|k.SHOW_PROCESSING_INSTRUCTION|k.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"),Zi=f(function(o){return typeof w=="function"&&o instanceof w},"_isNode");function J(o,r,a){it(o,b=>{b.call(t,r,a,Pe)})}f(J,"_executeHooks");let Ki=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()&&!Zi(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(!(Le.tagCheck instanceof Function&&Le.tagCheck(a))&&(!E[a]||et[a])){if(!et[a]&&Xi(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,L=Je(o)||o.childNodes;if(L&&b){let h=L.length;for(let ee=h-1;ee>=0;--ee){let G=vt(L[ee],!0);G.__removalCount=(o.__removalCount||0)+1,b.insertBefore(G,Ke(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,it([U,Ie,Me],b=>{r=Ve(r,b," ")}),o.textContent!==r&&(Be(t.removed,{element:o.cloneNode()}),o.textContent=r)),J(_.afterSanitizeElements,o,null),!1)},"_sanitizeElements"),Ji=f(function(o,r,a){if(Vi&&(r==="id"||r==="name")&&(a in i||a in ca))return!1;if(!(co&&!uo[r]&&N(At,r))&&!(Ni&&N(Et,r))&&!(Le.attributeCheck instanceof Function&&Le.attributeCheck(r,o))){if(!M[r]||uo[r]){if(!(Xi(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(Ci,Ve(a,$e,""))&&!((r==="src"||r==="xlink:href"||r==="href")&&o!=="script"&&ln(a,"data:")===0&&Ui[o])&&!(Pi&&!N(St,Ve(a,$e,"")))&&a)return!1}return!0},"_isValidAttribute"),Xi=f(function(o){return o!=="annotation-xml"&&zt(o,aa)},"_isBasicCustomElement"),$i=f(function(o){J(_.beforeSanitizeAttributes,o,null);let{attributes:r}=o;if(!r||ho(o))return;let a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0},b=r.length;for(;b--;){let L=r[b],{name:h,namespaceURI:ee,value:G}=L,Q=S(h),To=G,D=h==="value"?To:sn(To);if(a.attrName=Q,a.attrValue=D,a.keepAttr=!0,a.forceKeepAttr=void 0,J(_.uponSanitizeAttribute,o,a),D=a.attrValue,zi&&(Q==="id"||Q==="name")&&(ye(h,o),D=ra+D),It&&N(/((--!?|])>)|<\/(style|title|textarea)/i,D)){ye(h,o);continue}if(Q==="attributename"&&zt(D,"href")){ye(h,o);continue}if(a.forceKeepAttr)continue;if(!a.keepAttr){ye(h,o);continue}if(!Bi&&N(/\/>/i,D)){ye(h,o);continue}De&&it([U,Ie,Me],ma=>{D=Ve(D,ma," ")});let en=S(o.nodeName);if(!Ji(en,Q,D)){ye(h,o);continue}if(A&&typeof me=="object"&&typeof me.getAttributeType=="function"&&!ee)switch(me.getAttributeType(en,Q)){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):wo(t.removed)}catch{ye(h,o)}}J(_.afterSanitizeAttributes,o,null)},"_sanitizeAttributes"),fa=f(function o(r){let a=null,b=Wi(r);for(J(_.beforeSanitizeShadowDOM,r,null);a=b.nextNode();)J(_.uponSanitizeShadowNode,a,null),Ki(a),$i(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,L=null,h=null;if(bo=!o,bo&&(o="<!-->"),typeof o!="string"&&!Zi(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"&&(tt=!1),tt){if(o.nodeName){let Q=S(o.nodeName);if(!E[Q]||et[Q])throw ze("root node is forbidden and cannot be sanitized in-place")}}else if(o instanceof w)a=ji("<!---->"),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&&Lt?A.createHTML(o):o;if(a=ji(o),!a)return Ce?null:Lt?ae:""}a&&fo&&be(a.firstChild);let ee=Wi(tt?o:a);for(;L=ee.nextNode();)Ki(L),$i(L),L.content instanceof u&&fa(L.content);if(tt)return o;if(Ce){if(Mt)for(h=kt.call(a.ownerDocument);a.firstChild;)h.appendChild(a.firstChild);else h=a;return(M.shadowroot||M.shadowrootmode)&&(h=X.call(n,h,!0)),h}let G=ge?a.outerHTML:a.innerHTML;return ge&&E["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&N(Do,a.ownerDocument.doctype.name)&&(G="<!DOCTYPE "+a.ownerDocument.doctype.name+">"+G),De&&it([U,Ie,Me],Q=>{G=Ve(G,Q," ")}),A&&Lt?A.createHTML(G):G},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),L=S(r);return Ji(b,L,a)},t.addHook=function(o,r){typeof r=="function"&&Be(_[o],r)},t.removeHook=function(o,r){if(r!==void 0){let a=rn(_[o],r);return a===-1?void 0:dn(_[o],a,1)[0]}return wo(_[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<t.length;i++){let n=t[i].split("=");if(e==n[0].trim())return decodeURIComponent(n[1])}return null}function j(e){e&&(e.dispatchEvent(new PointerEvent("mousedown",{bubbles:!0,cancelable:!0,button:0})),e.dispatchEvent(new PointerEvent("click",{bubbles:!0,cancelable:!0,button:0})),e.dispatchEvent(new PointerEvent("mouseup",{bubbles:!0,cancelable:!0,button:0})))}function vn(){let e=document.createElement("style");e.textContent=`
|
|
.goodTube_hidden {
|
|
display: none !important;
|
|
}
|
|
`,document.head.appendChild(e)}function W(e){e&&!e.classList.contains("goodTube_hidden")&&e.classList.add("goodTube_hidden")}function rt(e){e&&e.classList.contains("goodTube_hidden")&&e.classList.remove("goodTube_hidden")}function z(){return window.location.href.indexOf("/watch/")!==-1||window.location.href.indexOf("/watch?")!==-1||window.location.href.indexOf("/live/")!==-1}function Qt(){if(z()){let e=document.querySelector(".video-ads"),t=document.querySelector(".ad-simple-attributed-string");return!!(e&&e.checkVisibility()||t&&t.checkVisibility())}}function dt(e,t){Ue&&(t=Ue.createHTML(t)),e.innerHTML=t}function wn(e,t,i){Ue&&(i=Ue.createHTML(i)),e.insertAdjacentHTML(t,i)}let re=!1,B=!1,d=!1,s=!1,He=!1,qt=!1,Po=!1,Bo=!1,Vo=!1,zo=!0,Fo=!1,jt=!1,te=!1,Ye=0,y=!1,Wt=document.hasFocus(),he=P("goodTube_shorts");he||(p("goodTube_shorts","false"),he="false");let Ge=P("goodTube_hideInfoCards");Ge||(p("goodTube_hideInfoCards","false"),Ge="false");let Qe=P("goodTube_hideEndScreen");Qe||(p("goodTube_hideEndScreen","false"),Qe="false");let lt=P("goodTube_hideSuggestedVideos");lt||(p("goodTube_hideSuggestedVideos","false"),lt="false");let st=P("goodTube_hideComments");st||(p("goodTube_hideComments","false"),st="false");let ut=P("goodTube_hideAiSummaries");ut||(p("goodTube_hideAiSummaries","false"),ut="false");let qe=P("goodTube_hideMembersOnlyVideos");qe||(p("goodTube_hideMembersOnlyVideos","false"),qe="false");let je=P("goodTube_alwaysStart");je||(p("goodTube_alwaysStart","false"),je="false");let ct=P("goodTube_blackBackground");ct||(p("goodTube_blackBackground","true"),ct="true");let Y=P("goodTube_videosPerRow");Y||(p("goodTube_videosPerRow","true"),Y="default");let Z=P("goodTube_autoplay");Z||(p("goodTube_autoplay","true"),Z="true");let Te=P("goodTube_playbackSpeed");Te||(Te="1");let T=No();function kn(){let e=`
|
|
.ytd-search ytd-shelf-renderer,
|
|
ytd-reel-shelf-renderer,
|
|
ytd-merch-shelf-renderer,
|
|
ytd-action-companion-ad-renderer,
|
|
ytd-display-ad-renderer,
|
|
|
|
ytd-video-masthead-ad-advertiser-info-renderer,
|
|
ytd-video-masthead-ad-primary-video-renderer,
|
|
ytd-in-feed-ad-layout-renderer,
|
|
ytd-ad-slot-renderer,
|
|
ytd-statement-banner-renderer,
|
|
ytd-banner-promo-renderer-background
|
|
ytd-ad-slot-renderer,
|
|
ytd-in-feed-ad-layout-renderer,
|
|
ytd-engagement-panel-section-list-renderer:not(.ytd-popup-container):not([target-id='engagement-panel-clip-create']):not(.ytd-shorts),
|
|
ytd-compact-video-renderer:has(.goodTube_hidden),
|
|
ytd-rich-item-renderer:has(> #content > ytd-ad-slot-renderer)
|
|
.ytd-video-masthead-ad-v3-renderer,
|
|
div#root.style-scope.ytd-display-ad-renderer.yt-simple-endpoint,
|
|
div#sparkles-container.style-scope.ytd-promoted-sparkles-web-renderer,
|
|
div#main-container.style-scope.ytd-promoted-video-renderer,
|
|
div#player-ads.style-scope.ytd-watch-flexy,
|
|
#clarify-box,
|
|
ytd-rich-item-renderer:has(> #content > ytd-ad-slot-renderer),
|
|
|
|
ytm-rich-shelf-renderer,
|
|
ytm-search ytm-shelf-renderer,
|
|
ytm-button-renderer.icon-avatar_logged_out,
|
|
ytm-companion-slot,
|
|
ytm-reel-shelf-renderer,
|
|
ytm-merch-shelf-renderer,
|
|
ytm-action-companion-ad-renderer,
|
|
ytm-display-ad-renderer,
|
|
ytm-rich-section-renderer,
|
|
ytm-video-masthead-ad-advertiser-info-renderer,
|
|
ytm-video-masthead-ad-primary-video-renderer,
|
|
ytm-in-feed-ad-layout-renderer,
|
|
ytm-ad-slot-renderer,
|
|
ytm-statement-banner-renderer,
|
|
ytm-banner-promo-renderer-background
|
|
ytm-ad-slot-renderer,
|
|
ytm-in-feed-ad-layout-renderer,
|
|
ytm-compact-video-renderer:has(.goodTube_hidden),
|
|
ytm-rich-item-renderer:has(> #content > ytm-ad-slot-renderer)
|
|
.ytm-video-masthead-ad-v3-renderer,
|
|
div#root.style-scope.ytm-display-ad-renderer.yt-simple-endpoint,
|
|
div#sparkles-container.style-scope.ytm-promoted-sparkles-web-renderer,
|
|
div#main-container.style-scope.ytm-promoted-video-renderer,
|
|
div#player-ads.style-scope.ytm-watch-flexy,
|
|
ytd-compact-movie-renderer,
|
|
|
|
yt-about-this-ad-renderer,
|
|
masthead-ad,
|
|
ad-slot-renderer,
|
|
yt-mealbar-promo-renderer,
|
|
statement-banner-style-type-compact,
|
|
ytm-promoted-sparkles-web-renderer,
|
|
tp-yt-iron-overlay-backdrop,
|
|
#masthead-ad
|
|
{
|
|
display: none !important;
|
|
}
|
|
|
|
.style-scope[page-subtype='channels'] ytd-shelf-renderer,
|
|
.style-scope[page-subtype='channels'] ytm-shelf-renderer {
|
|
display: block !important;
|
|
}
|
|
`;console.log("[GoodTube] Ads removed"),e+=`
|
|
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;
|
|
}
|
|
`,e+=`
|
|
ytd-miniplayer,
|
|
.ytp-miniplayer-button {
|
|
display: none !important;
|
|
}
|
|
`,he==="false"?(e+=`
|
|
ytm-pivot-bar-item-renderer:has(> .pivot-shorts),
|
|
ytd-rich-section-renderer,
|
|
grid-shelf-view-model {
|
|
display: none !important;
|
|
}
|
|
`,console.log("[GoodTube] Shorts removed")):e+=`
|
|
ytd-item-section-renderer[page-subtype='history'] ytd-reel-shelf-renderer {
|
|
display: block !important;
|
|
}
|
|
`,lt==="true"&&(e+=`
|
|
/* Hide suggested videos */
|
|
ytd-watch-flexy #secondary #related {
|
|
display: none !important;
|
|
}
|
|
|
|
/* Hide full sidebar if not playlist */
|
|
ytd-watch-flexy #secondary:not(:has(ytd-playlist-panel-video-renderer)) {
|
|
display: none !important;
|
|
}
|
|
`,console.log("[GoodTube] Suggested videos removed")),st==="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")),ut==="true"&&(e+=`
|
|
ytd-expandable-metadata-renderer[has-video-summary] {
|
|
display: none !important;
|
|
}
|
|
`,console.log("[GoodTube] AI summaries removed")),qe==="true"&&console.log("[GoodTube] Members only videos removed"),Y!=="default"&&console.log("[GoodTube] Videos per row on the home page set to "+Y);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 An(){document.querySelectorAll("ytd-rich-item-renderer:not(.goodTube_checked)").forEach(t=>{t.innerHTML.toLowerCase().indexOf("members only")!==-1&&W(t),t.classList.add("goodTube_checked")})}function En(){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&&(W(i),W(i.closest("ytd-video-renderer")),W(i.closest("ytd-compact-video-renderer")),W(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&&W(i),i.classList.add("goodTube_checked")})}function Sn(){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",""))),Wo(i)}))})}let pt=setTimeout(()=>{},0);function Zt(){if(he==="true"&&window.location.href.indexOf("/shorts")!==-1||!z()){clearTimeout(pt),pt=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(pt),pt=setTimeout(Zt,100)}function In(){if(Bo)return;let e=document.querySelector("#movie_player .ytp-autonav-toggle-button");e&&(e.getAttribute("aria-checked")==="true"&&j(e),Bo=!0)}function Mn(){document.querySelectorAll("yt-confirm-dialog-renderer").forEach(t=>{if(t.innerHTML.indexOf("Video paused. Continue watching?")!==-1){let i=t.querySelector("#confirm-button");i&&j(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 Yo(){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 Go=setTimeout(()=>{},0);function Qo(){d=document.getElementById("movie_player");let e=!1;if(d&&typeof d.getVideoData=="function"&&(e=d.getVideoData()),!e){clearTimeout(Go),Go=setTimeout(Qo,100);return}let t="transparent";ct==="true"&&(t="#000000");let i=document.createElement("style");i.textContent=`
|
|
/* Player wrapper */
|
|
#goodTube_playerWrapper {
|
|
border-radius: 12px;
|
|
background: `+t+`;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
z-index: 999;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* Theater mode */
|
|
#goodTube_playerWrapper.goodTube_theater {
|
|
border-radius: 0;
|
|
background: #000000;
|
|
}
|
|
|
|
/* No black background on dark theme */
|
|
html[darker-dark-theme][dark] #goodTube_playerWrapper {
|
|
background: transparent;
|
|
}
|
|
|
|
/* Fix size of Youtube player (this has to do with us setting the aspect ratio inside "goodTube_youtube_setAspectRatio") */
|
|
body:not(.goodTube_fallback) #primary.ytd-watch-flexy {
|
|
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 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,oi(),setInterval(oi,100)}let Kt=!1;function Dn(){if(y)Kt||(mt(!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",rt(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 jo(){if(de="",Cn(),!Fo){clearTimeout(qo),qo=setTimeout(jo,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()||mt();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(),navigator.userAgent.toLowerCase().indexOf("firefox")!==-1&>()}let ft=setTimeout(()=>{},0);function Jt(){if(!jt){clearTimeout(ft),ft=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(ft),ft=setTimeout(Jt,100);return}let i=Math.floor(d.getCurrentTime());i>=10&&Wo(i,t)}function mt(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","*")),W(re)}function Wo(e,t=""){B.contentWindow.postMessage("goodTube_skipTo_"+e+"|||"+t,"*")}function Cn(){B.contentWindow.postMessage("goodTube_pause","*")}let Ze=setTimeout(()=>{},0);function gt(){if(!Wt||!jt){clearTimeout(Ze),Ze=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(Ze),Ze=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",Zo,!0),document.addEventListener("keyup",Zo,!0)}function Zo(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,w=!1;if(t.forEach(x=>{(i===x.key||n===x.code)&&l===x.ctrl&&u===x.shift&&m===x.alt&&(w=!0)}),w){let x=e.srcElement,k=!1,ie=!1;if(x&&(typeof x.nodeName<"u"&&(k=x.nodeName.toLowerCase()),typeof x.getAttribute<"u"&&(ie=x.getAttribute("id"))),!x||k.indexOf("input")===-1&&k.indexOf("label")===-1&&k.indexOf("select")===-1&&k.indexOf("textarea")===-1&&k.indexOf("fieldset")===-1&&k.indexOf("legend")===-1&&k.indexOf("datalist")===-1&&k.indexOf("output")===-1&&k.indexOf("option")===-1&&k.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 Ko=setTimeout(()=>{},0);function Jo(){if(Z==="true")Xt();else if(te){if(We(),!te||!Ye){clearTimeout(Ko),Ko=setTimeout(Jo,100);return}Ye<te.length-1&&Xt()}}function Nn(){d=document.getElementById("movie_player");let e=!1;Z==="true"?e=!0:te&&(e=!0,Ye===te.length-1&&(e=!1)),e?B.contentWindow.postMessage("goodTube_endScreen_hide","*"):B.contentWindow.postMessage("goodTube_endScreen_show","*")}function Pn(){let e=new Date,t=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds()),n=new Date(t).toISOString().split("T")[0];P("goodTube_uniqueUserStat_"+n)||(fetch("https://jamenlyndon.com/_other/stats/users_daily.php",{referrerPolicy:"no-referrer"}),p("goodTube_uniqueUserStat_"+n,"true",2)),P("goodTube_uniqueUserStat")||(fetch("https://jamenlyndon.com/_other/stats/users_total.php",{referrerPolicy:"no-referrer"}),p("goodTube_uniqueUserStat","true"))}function Bn(){fetch("https://jamenlyndon.com/_other/stats/videos.php",{referrerPolicy:"no-referrer"})}let Xo=!1,$o=setTimeout(()=>{},0);function ei(e=!1){e||(window.top===window.self&&(console.log(`
|
|
==================================================
|
|
______ ________ __
|
|
/ ____/___ ____ ____/ /_ __/_ __/ /_ ___
|
|
/ / __/ __ \\/ __ \\/ __ / / / / / / / __ \\/ _ \\
|
|
/ /_/ / /_/ / /_/ / /_/ / / / / /_/ / /_/ / __/
|
|
\\____/\\____/\\____/\\____/ /_/ \\____/_____/\\___/
|
|
|
|
==================================================`),console.log("[GoodTube] Initiating...")),window.addEventListener("message",ti),Zt(),document.addEventListener("DOMContentLoaded",$t),(document.readyState==="interactive"||document.readyState==="complete")&&$t()),!document.body||!document.head?(clearTimeout($o),$o=setTimeout(()=>{ei(!0)},1)):$t()}function $t(){Xo||(Xo=!0,zn(),vn(),kn(),Qo(),Fn(),Pn(),Rn(),Vn())}let bt=setTimeout(()=>{},0);function ti(e){if(typeof e.data=="string")if(!document.body||!document.head?(clearTimeout(bt),bt=setTimeout(()=>{ti(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"&&mt());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")Jo();else if(e.data==="goodTube_theater"&&!document.fullscreenElement){let t=document.querySelector(".ytp-size-button");t&&j(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"),Yo(),ri(),navigator.userAgent.toLowerCase().indexOf("firefox")!==-1&>(),document.fullscreenElement&&(document.exitFullscreen(),window.setTimeout(()=>{let t=document.querySelector(".ytp-fullscreen-button");t&&j(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)if(window.location.href.indexOf("/shorts")!==-1)Yo();else{let t=e.data.replace("goodTube_syncAspectRatio_","").split("_");Ln(t[0],t[1])}else e.data==="goodTube_cancelPlay"&&clearTimeout(Ze)}function oi(){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()?(jo(),Bn()):mt(),Po=window.location.href),z()?(Nn(),Sn(),y||In(),Mn(),Dn(),Un()):(B.contentWindow.postMessage("goodTube_stopVideo","*"),Y!=="default"&&Ho(Y)),En(),qe==="true"&&An()}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="";lt==="true"&&(l=" checked");let u="";st==="true"&&(u=" checked");let m="";ut==="true"&&(m=" checked");let w="";qe==="true"&&(w=" checked");let x="";je==="true"&&(x=" checked");let k="";ct==="true"&&(k=" checked");let ie="",pe="",fe="",me="",ne="",vt="";ie==="default"?ie=" selected":Y==="2"?pe=" selected":Y==="3"?fe=" selected":Y==="4"?me=" selected":Y==="5"?ne=" selected":Y==="6"&&(vt=" selected"),dt(e,`
|
|
<!-- Menu Button
|
|
==================================================================================================== -->
|
|
<a href='javascript:;' class='goodTube_menuButton'>
|
|
<img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAZCAYAAABQDyyRAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjZBOUIxQTYzNDc0QjExRjA4OTZDRTk5QkFDRDUyNkFCIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjZBOUIxQTY0NDc0QjExRjA4OTZDRTk5QkFDRDUyNkFCIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NkE5QjFBNjE0NzRCMTFGMDg5NkNFOTlCQUNENTI2QUIiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NkE5QjFBNjI0NzRCMTFGMDg5NkNFOTlCQUNENTI2QUIiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7jrX2zAAADr0lEQVR42qRWzW4TMRCe2W4QFyqkvkARyqFQCXU3W4S48gDwClXzxwM1TVJehRMcaLKukIBeSlW1EufCoRTlZ/B41+txNgktdRRls2OP5/vmm7GRiECOYb2Zv0D9Jaj1uwh3GKrZBhIeo17HswfyT9poU+1tGzbevIYgwDtvzkNvTgaJfppMxjRrD0SkhLzddArnHz7CLDP/O+JeBzGHkWhwSoNkoNYeGuRRnR43XsHDFxsA45EJm1cN6y0zsdbfRzvPeovSHt6ChTwBABPtPwgr4AXATun0TD/8MhM31tcB9FcpBVG3g2WHZXZU3CheyuAYbbVahYuLc4Dra0h2dkwsadSgWPUwtBE6p8QRzUWCiP9ASgVStwZgdfUBPN3cBPjyFaTABQO+o+Nvx3B1dWXy5yd0hVU8NwqLOm20PHqYwewdQhxHBUgLJrSLOb9n70+Balt6atVMYlolnZTrQLIxnZLnFGuhFxhTjckTzc4P+HmpS+Ly0rOHkl6mEJfk2hInU8HlKkVGQKUUANzXD4/g5PsEMD0xfmPVNxac3cSI6XkCNB7nnUkVG/LUuJn43gk87ajuoQhc2zWjBWPa12z14DxFM23GmOjFwyOIGttOW5zHorWh29y6UUeZ3QYTbxUg5pWuC6DbJ4cqe0y7A909tvSeoUPLiMhuTi4xNoD0qFB4mo4BGXVzG2Z9Q7OOngb8ruHKBOVCsymKShObSzbsM8r3YvOSCHsHZB2rdCRkRLKV5QiV+O8CdVFhQQzmQk7V2B1GcSWz856NXd2IDPUIg4FukQH37jZKQRIJBkgExVqQlDL1CI4pcvUQd9uiM3ZIHzeQJBWT9uws0KiTAzcJugdFUtnX4HBk/G5vux4Oh4Psd22tJMQ/v6eCQAQLEpq7aAFyIHEcao009khGKMXI6eAqgFqU9Qh0EimEaZENRzO1r+cOlFkb1yol8Zk1zQ4Fcxq+O8jJ14KXbVsVBMXpCQieQIt3pbJdVoZ6hVKjvI+3kU8zTCdFZ8QkKonZdlEzPg2L8sSX9yDa66DSSI2/qOJgLCpD1kMhRB0U4jNNoxVTC1mYONOmuYEjTY3v6PM7VK39zDwJjI+o6+d97lng17fXGECesmTpFpOzbASAgeslaOwsxpVyimluAARAi65VTqT2EFk2JOJS3mcPuKV3P12Oaa4HRhTpFNzkCpbmOWdAhnKh/IWX0gV3HODUeg3oBgPzD9wg3HCpVUdeg/6tr8cR9wgo1/288VeAAQAP+uu2vDbm2wAAAABJRU5ErkJggg%3D%3D'>
|
|
</a> <!-- .goodTube_menuButton -->
|
|
<a href='javascript:;' class='goodTube_menuClose'>✖</a>
|
|
|
|
|
|
<!-- Modal
|
|
==================================================================================================== -->
|
|
<div class='goodTube_modal'>
|
|
<div class='goodTube_modal_overlay'></div>
|
|
|
|
<div class='goodTube_modal_inner'>
|
|
<a class='goodTube_modal_closeButton' href='javascript:;'>✖</a>
|
|
|
|
<div class='goodTube_title'>Settings</div>
|
|
<div class='goodTube_content'>
|
|
|
|
<div class='goodTube_setting'>
|
|
<input type='checkbox' class='goodTube_option_shorts' name='goodTube_option_shorts' id='goodTube_option_shorts'`+t+`>
|
|
<label for='goodTube_option_shorts'>Remove all shorts from Youtube</label>
|
|
</div> <!-- .goodTube_setting -->
|
|
|
|
<div class='goodTube_setting'>
|
|
<input type='checkbox' class='goodTube_option_hideInfoCards' name='goodTube_option_hideInfoCards' id='goodTube_option_hideInfoCards'`+i+`>
|
|
<label for='goodTube_option_hideInfoCards'>Hide info cards from videos</label>
|
|
</div> <!-- .goodTube_setting -->
|
|
|
|
<div class='goodTube_setting'>
|
|
<input type='checkbox' class='goodTube_option_hideEndScreen' name='goodTube_option_hideEndScren' id='goodTube_option_hideEndScreen'`+n+`>
|
|
<label for='goodTube_option_hideEndScreen'>Hide end screen suggested videos</label>
|
|
</div> <!-- .goodTube_setting -->
|
|
|
|
<div class='goodTube_setting'>
|
|
<input type='checkbox' class='goodTube_option_hideSuggestedVideos' name='goodTube_option_hideSuggestedVideos' id='goodTube_option_hideSuggestedVideos'`+l+`>
|
|
<label for='goodTube_option_hideSuggestedVideos'>Hide sidebar suggested videos</label>
|
|
</div> <!-- .goodTube_setting -->
|
|
|
|
<div class='goodTube_setting'>
|
|
<input type='checkbox' class='goodTube_option_hideComments' name='goodTube_option_hideComments' id='goodTube_option_hideComments'`+u+`>
|
|
<label for='goodTube_option_hideComments'>Hide comments</label>
|
|
</div> <!-- .goodTube_setting -->
|
|
|
|
<div class='goodTube_setting'>
|
|
<input type='checkbox' class='goodTube_option_hideAiSummaries' name='goodTube_option_hideAiSummaries' id='goodTube_option_hideAiSummaries'`+m+`>
|
|
<label for='goodTube_option_hideAiSummaries'>Hide AI summaries</label>
|
|
</div> <!-- .goodTube_setting -->
|
|
|
|
<div class='goodTube_setting'>
|
|
<input type='checkbox' class='goodTube_option_hideMembersOnlyVideos' name='goodTube_option_hideMembersOnlyVideos' id='goodTube_option_hideMembersOnlyVideos'`+w+`>
|
|
<label for='goodTube_option_hideMembersOnlyVideos'>Hide members only videos (paid channel restricted content)</label>
|
|
</div> <!-- .goodTube_setting -->
|
|
|
|
<div class='goodTube_setting'>
|
|
<input type='checkbox' class='goodTube_option_alwaysStart' name='goodTube_option_alwaysStart' id='goodTube_option_alwaysStart'`+x+`>
|
|
<label for='goodTube_option_alwaysStart'>Always play videos from the start</label>
|
|
</div> <!-- .goodTube_setting -->
|
|
|
|
<div class='goodTube_setting'>
|
|
<input type='checkbox' class='goodTube_option_blackBackground' name='goodTube_option_blackBackground' id='goodTube_option_blackBackground'`+k+`>
|
|
<label for='goodTube_option_blackBackground'>Use a black background for the video player</label>
|
|
</div> <!-- .goodTube_setting -->
|
|
|
|
<div class='goodTube_setting'>
|
|
<select class='goodTube_option_videosPerRow' name='goodTube_option_videosPerRow' id='goodTube_option_videosPerRow'>
|
|
<option`+ie+`>Default</option>
|
|
<option`+pe+`>2</option>
|
|
<option`+fe+`>3</option>
|
|
<option`+me+`>4</option>
|
|
<option`+ne+`>5</option>
|
|
<option`+vt+`>6</option>
|
|
</select>
|
|
<label for='goodTube_option_videosPerRow'>Videos per row on the home page</label>
|
|
</div> <!-- .goodTube_setting -->
|
|
|
|
<button class='goodTube_button' id='goodTube_button_saveSettings'>Save and refresh</button>
|
|
</div> <!-- .goodTube_content -->
|
|
|
|
|
|
<div class='goodTube_title'>Make a donation <span class='goodTube_heart'>♥</span></div>
|
|
<div class='goodTube_content'>
|
|
<div class='goodTube_donation'>
|
|
<div class="goodTube_text">
|
|
<strong>This adblocker is 100% free to use and always will be.<br>
|
|
It has helped over 175,000 people remove the unbearable ads from Youtube.</strong><br>
|
|
<br>
|
|
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).<br>
|
|
<br>
|
|
Donations help to keep this project going and support the wider community who use it. If you would like to say thank you and can give something back, it would be greatly appreciated.<br>
|
|
<br>
|
|
<i>Update -<br>Seriously everyone, I am flat broke - so small donations help a lot. If everyone donated just $1 I could finally go travelling with my partner rather than just living week to week.</i> \u{1F64F}\u{1F3FC}
|
|
</div>
|
|
<a href='https://tiptopjar.com/goodtube' target='_blank' rel='nofollow' class='goodTube_button'>Donate now</a>
|
|
</div> <!-- .goodTube_donation -->
|
|
</div> <!-- .goodTube_content -->
|
|
|
|
|
|
<div class='goodTube_title'>FAQs</div>
|
|
<div class='goodTube_content'>
|
|
<div class='goodTube_text'>
|
|
<strong>How can I share this with friends?</strong><br>
|
|
You can send them <a href='https://github.com/goodtube4u/goodtube' target='_blank'>this link</a>. It has all of the install instructions.<br>
|
|
<br>
|
|
<strong>Do I need to manually update this?</strong><br>
|
|
Nope, updates are pushed to you automatically so you don't have to do anything to use the latest version.<br>
|
|
<br>
|
|
<strong>Playlists skip to the next video every few seconds</strong><br>
|
|
This is usually caused by another adblocker which Youtube is detecting. To fix this problem, first disable all of your other adblockers (for Youtube only, you can leave them on for other websites). Then clear your cookies and cache (this is important). Once that's done, refresh Youtube and the problem should be fixed.<br>
|
|
<br>
|
|
<strong>I can't use the miniplayer</strong><br>
|
|
The Youtube miniplayer is not supported. Instead this uses "Picture in Picture" mode, which is the new standard for the web. Unfortunately Firefox does not support the Picture in Picture API, so the button is disabled in Firefox until they decide to include this feature.<br>
|
|
<br>
|
|
<strong>Is this compatible with other Youtube extensions?</strong><br>
|
|
Short answer - probably not. This heavily modifies how Youtube works in order to block ads. A key part of this is replacing the default Youtube player with their "embedded" player. This means that unless your extension also works for embedded Youtube videos (like where you view a Youtube video on another website), it generally won't be compatible. Unfortunately there's not much I can do to support these extensions as a result. Honestly though - you probably never needed them anyway, just play the video and be happy.<br>
|
|
<br>
|
|
<strong>I'm having a different problem</strong><br>
|
|
If you're having a different issue, most of the time you will find it's caused by a conflicting extension you have installed. The first thing to do is turn off all other extensions you have installed. Leave only Tampermonkey and GoodTube enabled. Then refresh Youtube, check if the problem is fixed. If it is, then you know one of them is causing the issue. Turn your other extensions back on back on one at a time until you find the problem.
|
|
</div>
|
|
</div> <!-- .goodTube_content -->
|
|
|
|
|
|
<div class='goodTube_title'>Report an issue</div>
|
|
<div class='goodTube_content'>
|
|
<div class='goodTube_text goodTube_successText'>Your message has been sent successfully.</div>
|
|
<form class='goodTube_report' onSubmit='javascript:;'>
|
|
<div class='goodTube_text'>
|
|
I am dedicated to helping every single person get this working. Everyone is important and if you have any problems at all, please let me know. I will respond and do my best to help!<br>
|
|
<br>
|
|
<i>* Please read the FAQs above before reporting an issue.</i>
|
|
</div>
|
|
<input class='goodTube_reportEmail' type='email' placeholder='Email address' required>
|
|
<textarea class='goodTube_reportText' placeholder='Enter your message here...\r\rPlease note - most reported issues are caused by a conflicting extension. Please first try turning off all of your other extensions. Refresh Youtube, check if the problem is fixed. If it is, then you know something is conflicting. Turn your other extensions back on one at a time until you find the cause. Please try this first before reporting an issue!' required></textarea>
|
|
<input type='submit' class='goodTube_button' id='goodTube_button_submitReport' value='Submit'>
|
|
</form> <!-- .goodTube_report -->
|
|
</div> <!-- .goodTube_content -->
|
|
|
|
|
|
</div> <!-- .goodTube_modal_inner -->
|
|
</div> <!-- .goodTube_modal -->
|
|
`);let wt=document.createElement("style");wt.textContent=`
|
|
/* Menu button
|
|
---------------------------------------------------------------------------------------------------- */
|
|
.goodTube_menuButton {
|
|
display: block;
|
|
position: fixed;
|
|
bottom: 16px;
|
|
right: 16px;
|
|
background: #0f0f0f;
|
|
border-radius: 9999px;
|
|
box-shadow: 0 0 10px rgba(0, 0, 0, .5);
|
|
width: 48px;
|
|
height: 48px;
|
|
z-index: 999;
|
|
transition: background .2s linear, opacity .2s linear, box-shadow .2s linear;
|
|
opacity: 1;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.goodTube_menuButton img {
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
pointer-events: none;
|
|
width: 26px;
|
|
}
|
|
|
|
.goodTube_menuButton::before {
|
|
content: 'Settings';
|
|
background: rgba(0, 0, 0, .9);
|
|
border-radius: 4px;
|
|
color: #ffffff;
|
|
font-size: 10px;
|
|
font-weight: 700;
|
|
text-transform: uppercase;
|
|
padding-top: 4px;
|
|
padding-bottom: 4px;
|
|
padding-left: 8px;
|
|
padding-right: 8px;
|
|
position: absolute;
|
|
left: 50%;
|
|
top: -26px;
|
|
transform: translateX(-50%);
|
|
letter-spacing: 0.04em;
|
|
opacity: 0;
|
|
transition: opacity .2s ease-in-out, top .2s ease-in-out;
|
|
pointer-events: none;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.goodTube_menuButton::after {
|
|
content: '';
|
|
position: absolute;
|
|
top: -6px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
width: 0;
|
|
height: 0;
|
|
border-left: 5px solid transparent;
|
|
border-right: 5px solid transparent;
|
|
border-top: 5px solid rgba(0, 0, 0, .9);
|
|
opacity: 0;
|
|
transition: opacity .2s ease-in-out, top .2s ease-in-out;
|
|
pointer-events: none;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.goodTube_menuButton:hover {
|
|
background: #252525;
|
|
box-shadow: 0 0 12px rgba(0, 0, 0, .5);
|
|
}
|
|
|
|
.goodTube_menuButton:hover::before,
|
|
.goodTube_menuButton:hover::after {
|
|
opacity: 1;
|
|
}
|
|
|
|
.goodTube_menuButton:hover::before {
|
|
top: -29px;
|
|
}
|
|
|
|
.goodTube_menuButton:hover::after {
|
|
top: -9px;
|
|
}
|
|
|
|
.goodTube_menuClose {
|
|
display: block;
|
|
position: fixed;
|
|
bottom: 51px;
|
|
right: 16px;
|
|
width: 14px;
|
|
height: 14px;
|
|
background: #ffffff;
|
|
color: #000000;
|
|
font-size: 9px;
|
|
font-weight: 700;
|
|
border-radius: 999px;
|
|
text-align: center;
|
|
line-height: 13px;
|
|
z-index: 9999;
|
|
box-shadow: 0 0 4px rgba(0, 0, 0, .5);
|
|
opacity: 1;
|
|
text-decoration: none;
|
|
cursor: pointer;
|
|
}
|
|
|
|
|
|
/* Modal container
|
|
---------------------------------------------------------------------------------------------------- */
|
|
.goodTube_modal {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
z-index: 9999;
|
|
opacity: 0;
|
|
transition: opacity .2s linear;
|
|
pointer-events: none;
|
|
backface-visibility: hidden;
|
|
min-width: 320px;
|
|
}
|
|
.goodTube_modal:not(.visible) .goodTube_button {
|
|
pointer-events: none;
|
|
}
|
|
|
|
.goodTube_modal.visible {
|
|
pointer-events: all;
|
|
opacity: 1;
|
|
}
|
|
.goodTube_modal.visible .goodTube_button {
|
|
pointer-events: all;
|
|
}
|
|
|
|
.goodTube_modal * {
|
|
box-sizing: border-box;
|
|
padding: 0;
|
|
margin: 0;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_modal_overlay {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
z-index: 1;
|
|
background: rgba(0,0,0,.8);
|
|
}
|
|
|
|
.goodTube_modal .goodTube_modal_inner {
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
transform: translate(round(-50%, 1px), round(-50%, 1px));
|
|
width: 780px;
|
|
max-width: calc(100% - 32px);
|
|
max-height: calc(100% - 32px);
|
|
z-index: 2;
|
|
background: #ffffff;
|
|
border-radius: 12px;
|
|
box-shadow: 0 0 24px rgba(0, 0, 0, .5);
|
|
font-family: Roboto, Arial, sans-serif;
|
|
padding: 24px;
|
|
overflow: auto;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_modal_inner .goodTube_modal_closeButton {
|
|
position: absolute;
|
|
top: 17px;
|
|
right: 12px;
|
|
color: #333;
|
|
font-size: 20px;
|
|
font-weight: 400;
|
|
text-decoration: none;
|
|
width: 40px;
|
|
height: 40px;
|
|
background: #ffffff;
|
|
border-radius: 9999px;
|
|
text-align: center;
|
|
line-height: 40px;
|
|
transition: background .2s linear;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_modal_inner .goodTube_modal_closeButton:hover {
|
|
background: #dddddd;
|
|
}
|
|
|
|
|
|
/* Modal inner
|
|
---------------------------------------------------------------------------------------------------- */
|
|
.goodTube_modal .goodTube_title {
|
|
font-weight: 700;
|
|
font-size: 22px;
|
|
padding-bottom: 16px;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_content {
|
|
padding-bottom: 24px;
|
|
border-bottom: 1px solid #eeeeee;
|
|
margin-bottom: 24px;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_content:last-child {
|
|
border-bottom: 0;
|
|
margin-bottom: 0;
|
|
padding-bottom: 0;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_content .goodTube_setting {
|
|
display: flex;
|
|
gap: 12px;
|
|
align-items: center;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_content .goodTube_setting input {
|
|
width: 24px;
|
|
height: 24px;
|
|
min-width: 24px;
|
|
min-height: 24px;
|
|
border-radius: 4px;
|
|
border: 1px solid #333;
|
|
overflow: hidden;
|
|
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;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_button {
|
|
all: initial;
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
display: inline-block;
|
|
background: #e84a82;
|
|
color: #ffffff;
|
|
text-align: center;
|
|
font-size: 15px;
|
|
font-weight: 700;
|
|
padding-top: 12px;
|
|
padding-bottom: 12px;
|
|
padding-left: 18px;
|
|
padding-right: 18px;
|
|
letter-spacing: 0.024em;
|
|
border-radius: 4px;
|
|
font-family: Roboto, Arial, sans-serif;
|
|
cursor: pointer;
|
|
transition: background .2s linear;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_button:hover {
|
|
background: #fa5b93;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_heart {
|
|
color: #e01b6a;
|
|
font-size: 24px;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_text {
|
|
display: block;
|
|
font-size: 15px;
|
|
padding-bottom: 16px;
|
|
line-height: 130%;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_text:last-child {
|
|
padding-bottom: 0;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_text a {
|
|
color: #e84a82;
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_report {
|
|
}
|
|
|
|
.goodTube_modal .goodTube_successText {
|
|
font-size: 15px;
|
|
padding-bottom: 16px;
|
|
line-height: 130%;
|
|
display: none;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_report input:not(.goodTube_button),
|
|
.goodTube_modal .goodTube_report textarea {
|
|
border-radius: 4px;
|
|
border: 1px solid #999;
|
|
width: 100%;
|
|
font-size: 14px;
|
|
color: #000000;
|
|
padding-top: 12px;
|
|
padding-bottom: 12px;
|
|
padding-left: 16px;
|
|
padding-right: 16px;
|
|
font-family: Roboto, Arial, sans-serif;
|
|
transition: border .2s linear;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_report input:not(.goodTube_button)::placeholder,
|
|
.goodTube_modal .goodTube_report textarea::placeholder {
|
|
color: #666666;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_report input:not(.goodTube_button):focus,
|
|
.goodTube_modal .goodTube_report textarea:focus {
|
|
border: 1px solid #333;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_report input:not(.goodTube_button) {
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.goodTube_modal .goodTube_report textarea {
|
|
margin-bottom: 16px;
|
|
height: 128px;
|
|
}
|
|
`,document.head.appendChild(wt);let Ke=document.querySelector(".goodTube_menuButton"),Je=document.querySelector(".goodTube_menuClose");Je&&Je.addEventListener("click",()=>{Ke.remove(),Je.remove()});let R=document.querySelector(".goodTube_modal"),A=document.querySelector(".goodTube_modal .goodTube_modal_overlay"),ae=document.querySelector(".goodTube_modal .goodTube_modal_closeButton");Ke&&Ke.addEventListener("click",()=>{if(R){let F=document.querySelector(".goodTube_report");F&&(F.style.display="block");let X=document.querySelector(".goodTube_successText");X&&(X.style.display="none");let _=document.querySelector(".goodTube_reportEmail");_&&(_.value="");let U=document.querySelector(".goodTube_reportText");U&&(U.value=""),R.classList.add("visible")}}),A&&A.addEventListener("click",()=>{R&&R.classList.contains("visible")&&R.classList.remove("visible")}),ae&&ae.addEventListener("click",()=>{R&&R.classList.contains("visible")&&R.classList.remove("visible")}),document.addEventListener("keydown",F=>{F.key.toLowerCase()==="escape"&&R&&R.classList.contains("visible")&&R.classList.remove("visible")});let Se=document.getElementById("goodTube_button_saveSettings");Se&&Se.addEventListener("click",()=>{let F=document.querySelector(".goodTube_option_shorts");F&&(F.checked?p("goodTube_shorts","false"):p("goodTube_shorts","true"));let X=document.querySelector(".goodTube_option_hideInfoCards");X&&(X.checked?p("goodTube_hideInfoCards","true"):p("goodTube_hideInfoCards","false"));let _=document.querySelector(".goodTube_option_hideEndScreen");_&&(_.checked?p("goodTube_hideEndScreen","true"):p("goodTube_hideEndScreen","false"));let U=document.querySelector(".goodTube_option_hideSuggestedVideos");U&&(U.checked?p("goodTube_hideSuggestedVideos","true"):p("goodTube_hideSuggestedVideos","false"));let Ie=document.querySelector(".goodTube_option_hideComments");Ie&&(Ie.checked?p("goodTube_hideComments","true"):p("goodTube_hideComments","false"));let Me=document.querySelector(".goodTube_option_hideAiSummaries");Me&&(Me.checked?p("goodTube_hideAiSummaries","true"):p("goodTube_hideAiSummaries","false"));let At=document.querySelector(".goodTube_option_hideMembersOnlyVideos");At&&(At.checked?p("goodTube_hideMembersOnlyVideos","true"):p("goodTube_hideMembersOnlyVideos","false"));let Et=document.querySelector(".goodTube_option_alwaysStart");Et&&(Et.checked?p("goodTube_alwaysStart","true"):p("goodTube_alwaysStart","false"));let St=document.querySelector(".goodTube_option_blackBackground");St&&(St.checked?p("goodTube_blackBackground","true"):p("goodTube_blackBackground","false"));let $e=document.querySelector(".goodTube_option_videosPerRow");$e&&p("goodTube_videosPerRow",$e.value.toString().toLowerCase()),window.location.href=window.location.href});let Xe=document.querySelector(".goodTube_report"),kt=document.querySelector(".goodTube_successText");Xe&&kt&&Xe.addEventListener("submit",F=>{F.preventDefault(),F.stopImmediatePropagation();let X={email:document.querySelector(".goodTube_reportEmail")?.value,message:document.querySelector(".goodTube_reportText")?.value},_={method:"POST",body:JSON.stringify(X),headers:{"Content-Type":"application/json; charset=UTF-8"},referrerPolicy:"no-referrer"};fetch("https://jamenlyndon.com/_other/stats/mail.php",_).then(U=>U.text()).then(U=>{Xe.style.display="none",kt.style.display="block"})})}function zn(){window.addEventListener("focus",()=>{Wt=!0}),window.addEventListener("blur",()=>{Wt=!1})}function Fn(){let e=document.createElement("style"),t=`
|
|
.ytp-skip-ad-button {
|
|
bottom: 48px !important;
|
|
right: 32px !important;
|
|
background: rgba(255, 255, 255, .175) !important;
|
|
opacity: 1 !important;
|
|
transition: background .1s linear !important;
|
|
}
|
|
|
|
.ytp-skip-ad-button:hover,
|
|
.ytp-skip-ad-button:focus {
|
|
background: rgba(255, 255, 255, .225) !important;
|
|
}
|
|
|
|
.ytp-ad-player-overlay-layout__player-card-container {
|
|
display: none !important;
|
|
}
|
|
|
|
.ytp-ad-player-overlay-layout__ad-info-container {
|
|
display: none !important;
|
|
}
|
|
|
|
.ytp-chrome-top {
|
|
display: none !important;
|
|
}
|
|
|
|
#goodTube_hideMuteAdsOverlay {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: #000000;
|
|
z-index: 851;
|
|
padding: 48px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
|
|
.goodTube_overlay_inner {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 24px;
|
|
max-width: 560px;
|
|
|
|
img {
|
|
width: 64px;
|
|
height: 50px;
|
|
min-width: 64px;
|
|
min-height: 50px;
|
|
}
|
|
|
|
.goodTube_overlay_textContainer {
|
|
font-family: Roboto, Arial, sans-serif;
|
|
margin-top: -9px;
|
|
|
|
.goodTube_overlay_textContainer_title {
|
|
font-size: 24px;
|
|
font-weight: 700;
|
|
}
|
|
|
|
.goodTube_overlay_textContainer_text {
|
|
font-size: 17px;
|
|
font-style: italic;
|
|
padding-top: 8px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`;navigator.userAgent.toLowerCase().indexOf("firefox")===-1&&(t+=`
|
|
.ytp-pip-button {
|
|
display: inline-block !important;
|
|
}
|
|
`),Ge==="true"&&(t+=`
|
|
.ytp-ce-covering-overlay,
|
|
.ytp-ce-element {
|
|
display: none !important;
|
|
}
|
|
`),Qe==="true"&&(t+=`
|
|
.ytp-videowall-still {
|
|
display: none !important;
|
|
}
|
|
`),e.textContent=t,document.head.appendChild(e);function i(n){if(!z()||de!=="enabled"||n.ctrlKey||n.altKey||n.metaKey)return;let l=n.key.toLowerCase(),u=n.srcElement,m=!1,w=!1;u&&(typeof u.nodeName<"u"&&(m=u.nodeName.toLowerCase()),typeof u.getAttribute<"u"&&(w=u.getAttribute("id"))),(!u||m.indexOf("input")===-1&&m.indexOf("label")===-1&&m.indexOf("select")===-1&&m.indexOf("textarea")===-1&&m.indexOf("fieldset")===-1&&m.indexOf("legend")===-1&&m.indexOf("datalist")===-1&&m.indexOf("output")===-1&&m.indexOf("option")===-1&&m.indexOf("optgroup")===-1&&w!=="contenteditable-root")&&(l===" "||l==="k"||l==="m"||l==="i")&&(n.preventDefault(),n.stopImmediatePropagation())}document.addEventListener("keydown",i,!0),document.addEventListener("keypress",i,!0),document.addEventListener("keyup",i,!0),ni()}function Un(){y&&z()?Qt()?Hn():Yn():de=""}let de="";function Hn(){let e=document.getElementById("goodTube_hideMuteAdsOverlay");if(de==="enabled"&&e)return;let t=document.querySelector("#movie_player video");t&&(t.playbackRate=2,t.muted=!0,t.volume=0,W(t));let i=document.querySelector(".ytp-chrome-bottom");i&&W(i);let n=document.getElementById("movie_player");n&&(n.style.pointerEvents="none");let l=document.querySelector(".ytp-caption-window-container");if(n&&W(l),!e){let u=document.createElement("div");u.setAttribute("id","goodTube_hideMuteAdsOverlay"),dt(u,`
|
|
<div class='goodTube_overlay_inner'>
|
|
<img src='data:image/gif;base64,R0lGODlhQAAyANU4AM1ml//MzcxlaP/LzM1maMxlZ//MzM1laMtkZspjlstkZ//Exe94ie10h8swZMwuYv+oqv+Vl/iQmdRtb8xldcphY81nl81paMpiZP/DxdZ5e80vY81pmtZ4es0wY/CImdZvcswuYf/Oz81mmfS1ts0xZM1mj8swY8xml++XqPGKjf/Q0ctklslilu51iMwxZcxmls1mlswxZP+Ym/+Zm8xlls0yZf+Ymv///wAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDkuMS1jMDAzIDc5Ljk2OTBhODdmYywgMjAyNS8wMy8wNi0yMDo1MDoxNiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDI2LjkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkIwRkZBNzNFQkI3RjExRjA4OTVBRDJBREJCNDlGMkY5IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkIwRkZBNzNGQkI3RjExRjA4OTVBRDJBREJCNDlGMkY5Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QjBGRkE3M0NCQjdGMTFGMDg5NUFEMkFEQkI0OUYyRjkiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QjBGRkE3M0RCQjdGMTFGMDg5NUFEMkFEQkI0OUYyRjkiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4B//79/Pv6+fj39vX08/Lx8O/u7ezr6uno5+bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL++vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI+OjYyLiomIh4aFhIOCgYB/fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAAAh+QQJEQA4ACwAAAAAQAAyAAAG/0CccEgsGo/I5BCBUCiYTKV0SlUynVBEVYjBFAqCsGBLHhIIJJJIFK52v+JxmXxOr9vJ8OEQCHzPc3NfGhp9Z4BHenx+BYiBW4OFAYcESGEVFX1xj0I2njYyMkROTmcdHQYGKyspKaFGl5kBm5yfoKJDpAqmqKqsrrhCLy8LCxkZxRMTKip4RLaeSKGer0VnN9g3MzPYLi7RQ8PFx8nLzXLP0NIy1MFmBNna3Dfe4EKh2/E0NNiO4S/TbKyzZeTMvn3xGjQYRgTfPGwIb/gTBpCdwCMB7b07yC+bQoZDPMXDFuYLEpNb9lgSAAJEwgYaRY4sWeBkzZQHVrZ8GdMGg/+fDD58oEDBhAmQRPaEOnHCgVMHtkKFchbSRo0aAADAgNHOiCegQYcWPfrCiFIZTJ9C/SRVBtVOVrFq5XprYNytWTUK+TKs7wtobGWoLBLqatYYMQLavYoXgF4cfP3+BXxrcEMZhgEgVizFU9arV4e19RRx27aI8YZFxQyaA4fHSjwDAF1DtFTSHU3PQJ1NdWDarmF3vnUVN0QaA5IPSNWnj/IBfThu84TY76N2xW1E3PecefPn0Q9Ot1G9bxV9HbGVKHE13rbuBvp4T57qdMetw9DHQ6I/2/r22bynnHfzLWeAfdjg90J/2PA3Uj43eLIVR9g0FwB98VnY3HY0lIf/DYT7HTGSPNhICAOFN1iIoYYbdrSPhySOZMQ+9iG21VahIEajbqa599ANKGKzmQw3wqAjDfYRseOLMRSZYww78vgjiEAeFM+QRR6ZJA4fzpBAAlcZEcpWxx0nYHLODeDjcdkZcdWXVG7zZZiEEQlDmVWeCd2FagY4zz5tFvFmAlTSSQSEw1wlwaISjAjBoxBEIGkEPrbQwpeIybSNmzXEY+gQiL6gKKOOQjoppX5aimkMms7AaYIwGIHeVU8iRttVHEW01VW2ykUdlOndYESRsmYDaA21xnBrDbneBwOvyvpKHrAhEkFsEbxtJZuNN2bVZY3R7lpDpnGhN+yNMwar9q0NhzXZLQDf7tZhuM+Oy2q5xtJwLhE+IoaYEBdc8MADIYQwMG2fLWtvRjbg4W8MVDrY5cMAC0ywwQ8gPJvCQ9risL8Ri5jNp9iMMAIKKFhggRAbbOCBB7aN9okQWdUMr7BDANigyNiQfIPJKKvMssswVyQzODZ7i7MQOi9dhH0+2/wvDp74Jtlk1YiL2M5MM4ukq0dAXQO/N0gdA1xWS9YVDlrHwDUOuH4t8Q2fHsvJEVs73fTcddPw6d1C5E3E3mX0XMO1c2RV5KaAk80YuoEofiPjjQsBq82P9MoCC283fnnNmUe7eeeV+/jIiJXzLM/pMm4RBAAh+QQFFAA4ACwAAAAAQAAyAAAG/0CccChEGBEKhZHIbDqf0KjziFQipNisligQiEQkEoGwLQ+73UIBg9F2v+Gx2YwWqNnY8TgQ0GjUc3NjanwHB11PegR8foCBZYMFhYcCTTIyKSkrKwYGHR1jSUlElzamNo9CdXwVFYhMl5mbnZ+hoqQyp6ipqwGtr0SmLi43NzMzxcVysLk2l0+6pk1dKioTEwsLGRnZLy/BNsPFx8k3y7imz07Ru1wC1dfZ293fQ94NDeU0+zTnQ7rqmqST4a3JmGL7yh0LiONevmT8+pFhAlAGNGcE6xE5eCNhsoUW/9nAVw4ECGBMDJVx1ERNl3LFpIkkmcwkSiIqt7Bk4lIAzP8bMtHZgAEDAIAaNYKeEXCp1CkHUB2cOHEpJxFvJkxQoPDhA4OvDJQKcUrUKFKxOLo0bWYqqlSqMqzae5F1a1ewYduJvBQjhtkaDIUYcsrOm+EXO4WYMkr0LMaLfP0eBRwS5wHC0Q57S4xjMYDGSR9LMcWBA1KkmL393HeMXEcaAy95O13DKNoopE2fTv1iNY3WyF7Hzkjbtl4th/uaOhaRz4DnA/jw6QR9gMd9plA3e5Q8xvIZzQNUlx6AOvTrsG1ov+1EH41y3ogi/D3D/HQD96u7Loa0RAn35TwBYDLxwTDfMfaVh5+C+gXHXw3+DViMgDC55k1f6JFHXoJ8zLf/D1GmjONgMhQqFNyFMWSoYX7RSechDSDaIOJPTbAGHg19EUVUZO55NONHwLW2T1+X6AgDhvTtQ4SNQ8ZgJI8Q8WOiiUHeSKQMRiLJHA1CiJhAAkgJpF4NHu13w3POQbflfMXsWNkQSH1p5jFfhknRmGWOiKZ4at7I5g1uNhFnAmbaSYRrpvT1ZQstmBnBoxFAICkEP0lgqQRIqWbMDILWUI6hQyBqg6IJMOoopJNSCtOlmNag6TGdtglDE+4pZ8NffSEl32sR0YZUX1ci5eMNTRhJa5S24hqDrgbyyo+vNQAbwyXCvkciE8YyMaxjudYAmpatFcOYjn0Zt+t8xepY96O1Dya6rLcw/Joifa6NS1S5AJhy7mvpEmGitKoIUFG30P6F1AMPhBACwhdcIIS0Zpa4KcBpCXxKZNAiZXANCCvMsMM4QDyixKCKa9TJil28VkYeeLDBBkJYYAEKKIwwwoRwenrtsQ/6e8PJKHem8lretPxyzDPXfDOxOQfoxJYl39AtUWM1o9kLpngjE75G4SxEtbA+fWPUU8+Kg1NXZ431LlwD4DUOYHPaXjJkx5CKE9USgZTTPN9Q992dKtn0zlscY6RRjxi5N9OAhzrD4QAkruPijfvMAgvyPgL0rpUPUczlmQeyebOd+8y3GRGXbjrhZaSuRRAAOw%3D%3D'>
|
|
<div class='goodTube_overlay_textContainer'>
|
|
<div class='goodTube_overlay_textContainer_title'>Sorry, we can't remove the ads from this video but we can hide and mute them!</div>
|
|
<div class='goodTube_overlay_textContainer_text'>Hang tight. Click the skip button if it appears to speed things up.</div>
|
|
</div>
|
|
</div>
|
|
`);let m=document.querySelector(".ytp-ad-player-overlay-layout");m&&m.prepend(u)}eo(!0),de="enabled"}function Yn(){if(de==="disabled")return;let e=document.querySelector("#movie_player video");e&&(e.playbackRate=Te,d=document.getElementById("movie_player"),d&&typeof d.unMute=="function"&&typeof d.setVolume=="function"&&typeof d.getVolume=="function"&&(e.volume<=0||e.muted||d.getVolume()===0)&&(e.muted=!1,e.volume=1,d.unMute(),d.setVolume(100)),rt(e));let t=document.querySelector(".ytp-chrome-bottom");t&&rt(t);let i=document.getElementById("movie_player");i&&(i.style.pointerEvents="auto");let n=document.querySelector(".ytp-caption-window-container");i&&rt(n);let l=document.getElementById("goodTube_hideMuteAdsOverlay");l&&l.remove(),eo(),de="disabled"}let ii=setTimeout(()=>{},0);function ni(){let e=document.querySelector("#movie_player .ytp-autonav-toggle-button");e?e.addEventListener("click",()=>{let t="true";e.getAttribute("aria-checked")==="true"&&(t="false"),p("goodTube_autoplay",t),B.contentWindow.postMessage("goodTube_autoplay_"+t,"*")}):(clearTimeout(ii),ii=setTimeout(ni,100))}let ai=setTimeout(()=>{},0);function ri(){let e=document.querySelector("#movie_player .ytp-autonav-toggle-button");e&&e.checkVisibility()?e.getAttribute("aria-checked")!==Z&&j(e):(clearTimeout(ai),ai=setTimeout(ri,100))}let di=setTimeout(()=>{},0);function eo(e=!1){if(!(!y||!z())&&(d=document.getElementById("movie_player"),d&&typeof d.playVideo=="function"&&typeof d.mute=="function"&&typeof d.setVolume=="function")){let t=document.querySelector("#movie_player video");if(d.playVideo(),e&&(d.mute(),d.setVolume(0)),t){e&&(t.muted=!0,t.volume=0);let i=t.currentTime;clearTimeout(di),di=setTimeout(()=>{t.currentTime===i&&eo()},100)}}}let li=!1,si=setTimeout(()=>{},0);function ui(e=!1){e||(window.addEventListener("message",ht),document.addEventListener("DOMContentLoaded",yt),(document.readyState==="interactive"||document.readyState==="complete")&&yt()),!document.body||!document.head?(clearTimeout(si),si=setTimeout(()=>{ui(!0)},1)):yt()}let ci=setTimeout(()=>{},0);function yt(){s=document.getElementById("movie_player");let e=!1;if(s&&typeof s.getVideoData=="function"&&(e=s.getVideoData()),!e){clearTimeout(ci),ci=setTimeout(yt,1);return}li||(li=!0,jn(),gi(),yi(),Zn(),Ae(),$n(),setInterval(Ii,5e3),Qn(),pi(),setInterval(pi,100),window.top.postMessage("goodTube_playerIframe_loaded","*"))}function pi(){Gn(),Xn(),qn(),ea(),T.goodTube_playlist!=="undefined"&&T.goodTube_playlist==="true"&&fi(),ta()}function Gn(){document.querySelector(".ytp-error")?y||(y=!0,window.top.postMessage("goodTube_fallback_enable","*"),Ae(),clearTimeout(Tt)):y&&(y=!1,window.top.postMessage("goodTube_fallback_disable","*"),Ae(),clearTimeout(Tt))}function Qn(){typeof T.goodTube_playbackSpeed<"u"&&s&&typeof s.setPlaybackRate=="function"&&s.setPlaybackRate(parseFloat(T.goodTube_playbackSpeed)),setInterval(()=>{s&&typeof s.getPlaybackRate=="function"&&window.top.postMessage("goodTube_playbackSpeed_"+s.getPlaybackRate(),"*")},100)}function qn(){document.querySelectorAll(".ytp-videowall-still:not(.goodTube_fixed), .ytp-ce-covering-overlay:not(.goodTube_fixed)").forEach(t=>{t.addEventListener("click",i=>{i.preventDefault(),i.stopImmediatePropagation(),window.top.location.href=t.href},!0),t.addEventListener("mousedown",i=>{i.button===0&&(i.preventDefault(),i.stopImmediatePropagation())},!0),t.addEventListener("mouseup",i=>{i.button===0&&(i.preventDefault(),i.stopImmediatePropagation())},!0),t.addEventListener("touchstart",i=>{i.preventDefault(),i.stopImmediatePropagation()},!0),t.addEventListener("touchend",i=>{i.preventDefault(),i.stopImmediatePropagation()},!0),t.classList.add("goodTube_fixed")})}function jn(){let e=document.createElement("style"),t=`
|
|
/* Hide unwanted stuff */
|
|
.ytp-gradient-top,
|
|
.ytp-show-cards-title,
|
|
.ytp-pause-overlay,
|
|
.ytp-youtube-button,
|
|
.ytp-cued-thumbnail-overlay,
|
|
.ytp-paid-content-overlay,
|
|
.ytp-impression-link,
|
|
.ytp-ad-progress-list,
|
|
.ytp-endscreen-next,
|
|
.ytp-endscreen-previous,
|
|
.ytp-info-panel-preview,
|
|
.ytp-generic-popup,
|
|
.goodTube_hideEndScreen .html5-endscreen {
|
|
display: none !important;
|
|
}
|
|
|
|
.html5-endscreen {
|
|
top: 0 !important;
|
|
}
|
|
|
|
/* Disable click events on the top area */
|
|
.ytp-chrome-top {
|
|
pointer-events: none !important;
|
|
}
|
|
|
|
/* Always show the next button */
|
|
.ytp-next-button {
|
|
opacity: 1 !important;
|
|
cursor: pointer !important;
|
|
display: block !important;
|
|
}
|
|
|
|
/* Show the prev button if it has the right class */
|
|
.ytp-prev-button.goodTube_visible {
|
|
opacity: 1 !important;
|
|
cursor: pointer !important;
|
|
display: block !important;
|
|
}
|
|
|
|
/* Show video title in fullscreen */
|
|
:fullscreen .ytp-gradient-top,
|
|
:fullscreen .ytp-show-cards-title {
|
|
display: block !important;
|
|
}
|
|
:fullscreen .ytp-show-cards-title .ytp-button,
|
|
:fullscreen .ytp-show-cards-title .ytp-title-channel {
|
|
display: none !important;
|
|
}
|
|
:fullscreen .ytp-show-cards-title .ytp-title-text {
|
|
padding-left: 36px !important;
|
|
}
|
|
|
|
/* Add theater mode button */
|
|
.ytp-size-button {
|
|
display: inline-block !important;
|
|
}
|
|
|
|
/* Hide theater button in fullscreen (don't use display none, it causes issues with keyboard shortcuts if this was the last focused element) */
|
|
body .ytp-fullscreen .ytp-size-button {
|
|
position: fixed !important;
|
|
top: -9999px !important;
|
|
left: -9999px !important;
|
|
bottom: auto !important;
|
|
right: auto !important;
|
|
opacity: 0 !important;
|
|
pointer-events: none !important;
|
|
}
|
|
|
|
/* Style autoplay button */
|
|
#goodTube_autoplayButton {
|
|
overflow: visible;
|
|
position: relative;
|
|
}
|
|
|
|
#goodTube_autoplayButton .ytp-autonav-toggle-button::before {
|
|
pointer-events: none;
|
|
opacity: 0;
|
|
position: absolute;
|
|
top: -49px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
background: rgba(28, 28, 28, 0.9);
|
|
color: #ffffff;
|
|
border-radius: 4px;
|
|
font-weight: 500;
|
|
font-size: 12.98px;
|
|
padding-left: 9px;
|
|
padding-right: 9px;
|
|
padding-bottom: 0;
|
|
height: 25px;
|
|
box-sizing: border-box;
|
|
line-height: 25px;
|
|
font-family: "YouTube Noto", Roboto, Arial, Helvetica, sans-serif;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
#goodTube_autoplayButton .ytp-autonav-toggle-button[aria-checked='true']::before {
|
|
content: 'Auto-play is on';
|
|
}
|
|
|
|
#goodTube_autoplayButton .ytp-autonav-toggle-button[aria-checked='false']::before {
|
|
content: 'Auto-play is off';
|
|
}
|
|
|
|
#goodTube_autoplayButton:hover .ytp-autonav-toggle-button::before {
|
|
opacity: 1;
|
|
}
|
|
|
|
.ytp-big-mode #goodTube_autoplayButton .ytp-autonav-toggle-button {
|
|
transform: scale(1.4);
|
|
top: 21px;
|
|
}
|
|
|
|
.ytp-big-mode #goodTube_autoplayButton .ytp-autonav-toggle-button::before {
|
|
font-size: 14px;
|
|
height: 23px;
|
|
line-height: 23px;
|
|
}
|
|
|
|
/* Make sure the background is transparent */
|
|
body,
|
|
.html5-video-player {
|
|
background: transparent !important;
|
|
}
|
|
`;navigator.userAgent.toLowerCase().indexOf("firefox")===-1&&(t+=`
|
|
.ytp-pip-button {
|
|
display: inline-block !important;
|
|
}
|
|
`),T.goodTube_hideInfoCards==="true"&&(t+=`
|
|
.ytp-ce-covering-overlay,
|
|
.ytp-ce-element {
|
|
display: none !important;
|
|
}
|
|
`),T.goodTube_hideEndScreen==="true"&&(t+=`
|
|
.ytp-videowall-still {
|
|
display: none !important;
|
|
}
|
|
`),e.textContent=t,document.head.appendChild(e)}function fi(){let e=document.querySelector(".ytp-prev-button");e&&!e.classList.contains("goodTube_visible")&&e.classList.add("goodTube_visible")}function Wn(){let e=document.querySelector(".ytp-prev-button");e&&e.classList.contains("goodTube_visible")&&e.classList.remove("goodTube_visible")}let mi=setTimeout(()=>{},0);function gi(){if(!document.querySelector(".ytp-play-button")){clearTimeout(mi),mi=setTimeout(gi,100);return}let t=document.querySelector(".ytp-prev-button");t&&t.addEventListener("click",function(){window.top.postMessage("goodTube_prevVideo","*")});let i=document.querySelector(".ytp-next-button");i&&i.addEventListener("click",function(){window.top.postMessage("goodTube_nextVideo","*")});let n=document.querySelector(".ytp-size-button");n&&(n.setAttribute("data-tooltip-target-id","ytp-size-button"),n.setAttribute("data-title-no-tooltip","Theater mode (t)"),n.setAttribute("aria-label","Theater mode (t)"),n.setAttribute("title","Theater mode (t)"),n.setAttribute("data-tooltip-title","Theater mode (t)"),dt(n,`
|
|
<svg height="100%" version="1.1" viewBox="0 0 36 36" width="100%"><use class="ytp-svg-shadow" xlink:href="#ytp-id-30"></use><path d="m 28,11 0,14 -20,0 0,-14 z m -18,2 16,0 0,10 -16,0 0,-10 z" fill="#fff" fill-rule="evenodd" id="ytp-id-30"></path></svg>
|
|
`),n.addEventListener("click",function(){window.top.postMessage("goodTube_theater","*")}));let l=document.querySelector(".ytp-subtitles-button");if(l){wn(l,"beforebegin",'<button class="ytp-button ytp-autonav-toggle" id="goodTube_autoplayButton"><div class="ytp-autonav-toggle-button-container"><div class="ytp-autonav-toggle-button" aria-checked="'+T.goodTube_autoplay+'"></div></div></button>');let u=document.querySelector("#goodTube_autoplayButton");u&&u.addEventListener("click",function(){let m=u.querySelector(".ytp-autonav-toggle-button");m.getAttribute("aria-checked")==="true"?(m.setAttribute("aria-checked","false"),window.top.postMessage("goodTube_autoplay_false","*")):(m.setAttribute("aria-checked","true"),window.top.postMessage("goodTube_autoplay_true","*"))})}}let bi=setTimeout(()=>{},0);function yi(){let e=document.querySelector("#movie_player video");if(!e){clearTimeout(bi),bi=setTimeout(yi,100);return}e.addEventListener("ended",function(){Ii(!0),window.top.postMessage("goodTube_videoEnded","*")})}function Zn(){document.addEventListener("keydown",function(e){if(e.ctrlKey||e.altKey||e.metaKey||y)return;let t=e.key.toLowerCase();if(t==="t"&&window.top.postMessage("goodTube_theater","*"),t==="i"){let i=document.querySelector(".ytp-pip-button");i&&j(i)}else t==="p"&&e.shiftKey||t==="mediatrackprevious"?window.top.postMessage("goodTube_prevVideo","*"):(t==="n"&&e.shiftKey||t==="mediatracknext")&&window.top.postMessage("goodTube_nextVideo","*")})}let oe=setTimeout(()=>{},0),K=!1,le=-1,se=!1,ue=!1,ce=!1,g=document.querySelector("video"),I=document.querySelector(".goodTube_doubleSpeed");function to(e){let t=e.key.toLowerCase();if(t===" "||t==="k"){if(y)return;if(ue){e.preventDefault(),e.stopImmediatePropagation();return}if(e.ctrlKey||e.altKey||e.metaKey||(e.preventDefault(),e.stopImmediatePropagation(),K)||se)return;se=!0,le=s.getPlaybackRate(),clearTimeout(oe),oe=setTimeout(()=>{s.setPlaybackRate(2),s.playVideo(),I.style.display="block",K=!0},1e3)}}function oo(e){let t=e.key.toLowerCase();if(t===" "||t==="k"){if(y)return;if(ue){e.preventDefault(),e.stopImmediatePropagation();return}if(e.ctrlKey||e.altKey||e.metaKey)return;e.preventDefault(),e.stopImmediatePropagation()}}function io(e){let t=e.key.toLowerCase();if(t===" "||t==="k"){if(y)return;if(ue){e.preventDefault(),e.stopImmediatePropagation();return}if(e.ctrlKey||e.altKey||e.metaKey)return;clearTimeout(oe),K?(s.setPlaybackRate(le),I.style.display="none",K=!1):(g=document.querySelector("video"),ce=!0,j(g),ce=!1,window.top.postMessage("goodTube_cancelPlay","*")),se=!1,e.preventDefault(),e.stopImmediatePropagation()}}function ve(e){if(e.button===0&&!ce&&!y){if(se){e.preventDefault(),e.stopImmediatePropagation();return}ue=!0,e.preventDefault(),e.stopImmediatePropagation(),le=s.getPlaybackRate(),clearTimeout(oe),oe=setTimeout(()=>{s.setPlaybackRate(2),s.playVideo(),I.style.display="block",K=!0},1e3)}}function no(e){ce||y||(e.preventDefault(),e.stopImmediatePropagation())}function we(e){if(e.button===0&&!ce&&!y){if(se){e.preventDefault(),e.stopImmediatePropagation();return}clearTimeout(oe),K?(s.setPlaybackRate(le),I.style.display="none",K=!1):(g=document.querySelector("video"),ce=!0,j(g),ce=!1,setTimeout(g.focus()),window.top.postMessage("goodTube_cancelPlay","*")),ue=!1,e.preventDefault(),e.stopImmediatePropagation()}}function ke(e){if(!y){if(se){e.preventDefault(),e.stopImmediatePropagation();return}e.preventDefault(),e.stopImmediatePropagation(),clearTimeout(oe),K&&(s.setPlaybackRate(le),I.style.display="none",K=!1),ue=!1}}let _t=setTimeout(()=>{},0);function Ae(){if(clearTimeout(oe),K=!1,se=!1,ue=!1,g=document.querySelector("video"),I=document.querySelector(".goodTube_doubleSpeed"),y){document.removeEventListener("keydown",to,!0),document.removeEventListener("keypress",oo,!0),document.removeEventListener("keyup",io,!0),g&&(g.removeEventListener("mousedown",ve,!0),g.removeEventListener("touchstart",ve,!0),g.removeEventListener("click",no,!0),g.removeEventListener("mouseup",we,!0),g.removeEventListener("touchend",we,!0),g.removeEventListener("mouseout",ke,!0),g.removeEventListener("touchcancel",ke,!0)),I&&(I.style.display="none");return}if(!g){clearTimeout(_t),_t=setTimeout(Ae,100);return}if(s=document.getElementById("movie_player"),!s||typeof s.getPlaybackRate!="function"||typeof s.setPlaybackRate!="function"||typeof s.playVideo!="function"){clearTimeout(_t),_t=setTimeout(Ae,100);return}if(le=s.getPlaybackRate(),s.setPlaybackRate(le),I)I.style.display="none";else{I=document.createElement("div"),I.classList.add("goodTube_doubleSpeed"),I.style.position="relative",I.style.zIndex="999",I.style.display="none",dt(I,`
|
|
<div class="ytp-overlay ytp-speedmaster-overlay" data-layer="4">
|
|
<div class="ytp-speedmaster-user-edu ytp-speedmaster-has-icon">
|
|
<div class="ytp-speedmaster-label">2x</div>
|
|
<div class="ytp-speedmaster-icon">
|
|
<svg height="100%" version="1.1" viewBox="0 0 36 36" width="100%">
|
|
<path class="ytp-svg-fill" d="M 10,24 18.5,18 10,12 V 24 z M 19,12 V 24 L 27.5,18 19,12 z" id="ytp-id-1"></path>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`);let e=document.querySelector(".html5-video-player");e&&e.appendChild(I)}document.removeEventListener("keydown",to,!0),document.addEventListener("keydown",to,!0),document.removeEventListener("keypress",oo,!0),document.addEventListener("keypress",oo,!0),document.removeEventListener("keyup",io,!0),document.addEventListener("keyup",io,!0),g.removeEventListener("mousedown",ve,!0),g.addEventListener("mousedown",ve,!0),g.removeEventListener("touchstart",ve,!0),g.addEventListener("touchstart",ve,!0),g.removeEventListener("click",no,!0),g.addEventListener("click",no,!0),g.removeEventListener("mouseup",we,!0),g.addEventListener("mouseup",we,!0),g.removeEventListener("touchend",we,!0),g.addEventListener("touchend",we,!0),g.removeEventListener("mouseout",ke,!0),g.addEventListener("mouseout",ke,!0),g.removeEventListener("touchcancel",ke,!0),g.addEventListener("touchcancel",ke,!0)}function Kn(e,t){s=document.getElementById("movie_player"),s&&typeof s.loadVideoById=="function"&&(s.loadVideoById({videoId:e,startSeconds:t}),Ae())}let Ee=setTimeout(()=>{},0);function ht(e){if(typeof e.data!="string")return;if(!document.body||!document.head){clearTimeout(Ee),Ee=setTimeout(()=>{ht(e)},100);return}s=document.getElementById("movie_player");let t=!1;if(s&&typeof s.getVideoData=="function"&&(t=s.getVideoData()),!t){clearTimeout(Ee),Ee=setTimeout(()=>{ht(e)},100);return}if(e.data.indexOf("goodTube_load_")!==-1){let i=e.data.replace("goodTube_load_","").split("|||"),n=i[0],l=parseFloat(i[1]);i[2]==="true"?fi():Wn(),Kn(n,l)}else if(e.data==="goodTube_stopVideo")ro(),ki();else if(e.data.indexOf("goodTube_skipTo_")!==-1){let i=e.data.replace("goodTube_skipTo_","").split("|||"),n=parseFloat(i[0]),l=i[1];if(l!==""&&t.video_id!==l){clearTimeout(Ee),Ee=setTimeout(()=>{ht(e)},100);return}xi(n)}else if(e.data==="goodTube_pause")ro();else if(e.data.indexOf("goodTube_play|||")!==-1)Si(e.data.replace("goodTube_play|||",""));else if(e.data==="goodTube_endScreen_show")document.body&&document.body.classList.contains("goodTube_hideEndScreen")&&document.body.classList.remove("goodTube_hideEndScreen");else if(e.data==="goodTube_endScreen_hide")document.body&&!document.body.classList.contains("goodTube_hideEndScreen")&&document.body.classList.add("goodTube_hideEndScreen");else if(e.data.indexOf("goodTube_shortcut_")!==-1){let i=document.querySelector("video");if(i){let n=e.data.replace("goodTube_shortcut_","").split("_"),l=n[0],u={bubbles:!0,key:n[1],keyCode:n[2],ctrlKey:n[3]==="true",metaKey:n[4]==="true",shiftKey:n[5]==="true",altKey:n[6]==="true"};i.dispatchEvent(new KeyboardEvent(l,u))}}else e.data==="goodTube_fullscreen"?_i():e.data==="goodTube_autoplay_true"?(p("goodTube_autoplay","true"),Z="true",ao("true")):e.data==="goodTube_autoplay_false"&&(p("goodTube_autoplay","false"),Z="false",ao("false"))}let Tt=setTimeout(()=>{},0);function _i(){let e=document.querySelector(".ytp-fullscreen-button");e?j(e):(clearTimeout(Tt),Tt=setTimeout(_i,100))}let hi=setTimeout(()=>{},0);function ao(e){let t=document.querySelector("#goodTube_autoplayButton");t?t.querySelector(".ytp-autonav-toggle-button").getAttribute("aria-checked")!==e&&j(t):(clearTimeout(hi),hi=setTimeout(()=>{ao(e)},100))}let Ti=setTimeout(()=>{},0);function xi(e){let t=document.querySelector("video");t?t.currentTime=parseFloat(e):(clearTimeout(Ti),Ti=setTimeout(()=>{xi(e)},100))}let vi=setTimeout(()=>{},0);function ro(){let e=document.querySelector("video");e?e.pause():(clearTimeout(vi),vi=setTimeout(ro,100)),window.top.postMessage("goodTube_cancelPlay","*")}let wi=setTimeout(()=>{},0);function ki(){let e=document.querySelector("video");e?e.muted=!0:(clearTimeout(wi),wi=setTimeout(ki,100))}let Ai=setTimeout(()=>{},0);function Jn(){let e=document.querySelector("video");e?e.muted=!1:(clearTimeout(Ai),Ai=setTimeout(Jn,100))}let Ei=setTimeout(()=>{},0);function Si(e){s=document.getElementById("movie_player");let t=!1;if(s&&typeof s.getVideoData=="function"&&(t=s.getVideoData()),!t||e!==t.video_id){clearTimeout(Ei),Ei=setTimeout(()=>{Si(e)},100);return}let i=document.querySelector("#movie_player video");i&&i.currentTime>=i.duration||s&&typeof s.playVideo=="function"&&s.playVideo()}function Xn(){let e=document.querySelector(".ytp-fullscreen-button");e&&(e.setAttribute("aria-disabled","false"),document.querySelector(".ytp-fullscreen")?e.setAttribute("title","Exit full screen (f)"):e.setAttribute("title","Full screen (f)"))}function Ii(e=!1){let t=document.querySelector("video");if(t){let i=t.currentTime;e&&(i=t.duration),window.top.postMessage("goodTube_syncMainPlayer_"+i,"*")}}function $n(){addEventListener("leavepictureinpicture",e=>{He=!1,window.top.postMessage("goodTube_pip_false","*")}),addEventListener("enterpictureinpicture",e=>{He=!0,window.top.postMessage("goodTube_pip_true","*")})}function ea(){"mediaSession"in navigator&&(navigator.mediaSession.setActionHandler("nexttrack",()=>{window.top.postMessage("goodTube_nextVideo","*")}),navigator.mediaSession.setActionHandler("previoustrack",()=>{window.top.postMessage("goodTube_prevVideo","*")}))}function ta(){let e=document.querySelector("video");if(e){let n=function(m,w){return w==0?m:n(w,m%w)},l=function(m,w){var x=n(m,w);return[m/x,w/x]},t=e.videoWidth,i=e.videoHeight,u=l(t,i);u.length===2&&!isNaN(u[0])&&!isNaN(u[1])&&window.top.postMessage("goodTube_syncAspectRatio_"+u[0]+"_"+u[1],"*")}}let Mi=!1,Li=setTimeout(()=>{},0);function Di(){window.addEventListener("message",so),document.addEventListener("DOMContentLoaded",lo),(document.readyState==="interactive"||document.readyState==="complete")&&lo(),!document.body||!document.head?(clearTimeout(Li),Li=setTimeout(Di,1)):lo()}function lo(){Mi||(Mi=!0,oa(),ia(),window.top.postMessage("goodTube_proxyIframe_loaded","*"))}function oa(){let e=document.createElement("style");e.textContent=`
|
|
/* Hide the page */
|
|
body *:not(#goodTube_youtube_iframe) {
|
|
display: none !important;
|
|
opacity: 0 !important;
|
|
visibility: hidden !important;
|
|
}
|
|
|
|
body {
|
|
background: transparent !important;
|
|
overflow: hidden !important;
|
|
}
|
|
|
|
/* Style the Youtube iframe */
|
|
#goodTube_youtube_iframe {
|
|
position: fixed;
|
|
top: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
z-index: 99999;
|
|
}
|
|
`,document.head.appendChild(e)}function ia(){let e=document.createElement("iframe");e.src="",e.setAttribute("width","100%"),e.setAttribute("height","100%"),e.setAttribute("frameborder","0"),e.setAttribute("scrolling","yes"),e.setAttribute("allow","accelerometer *; autoplay *; clipboard-write *; encrypted-media *; gyroscope *; picture-in-picture *; web-share *;"),e.setAttribute("referrerpolicy","strict-origin-when-cross-origin"),e.setAttribute("allowfullscreen",!0),e.setAttribute("id","goodTube_youtube_iframe"),document.body.appendChild(e)}let xt=setTimeout(()=>{},0);function so(e){if(typeof e.data!="string")return;(!document.body||!document.head)&&(clearTimeout(xt),xt=setTimeout(()=>{so(e)},100));let t=document.getElementById("goodTube_youtube_iframe");t?e.data.indexOf("goodTube_src_")!==-1?t.src===""||t.src.indexOf("?goodTubeProxy=1")!==-1?t.src=e.data.replace("goodTube_src_",""):t.contentWindow.location.replace(e.data.replace("goodTube_src_","")):t.contentWindow.postMessage(e.data,"*"):(clearTimeout(xt),xt=setTimeout(()=>{so(e)},100))}function na(){window.top===window.self&&window.location.href.indexOf("youtube")!==-1?ei():window.location.href.indexOf("?goodTubeProxy=1")!==-1?Di():window.location.href.indexOf("?goodTubeEmbed=1")!==-1&&ui()}na()})();})();
|