mirror of
https://github.com/goodtube4u/goodtube.git
synced 2025-11-22 10:16:11 +00:00
860 lines
93 KiB
JavaScript
860 lines
93 KiB
JavaScript
(()=>{(function(){"use strict";var Gi=Object.defineProperty,f=(e,t)=>Gi(e,"name",{value:t,configurable:!0}),{entries:po,setPrototypeOf:fo,isFrozen:Qi,getPrototypeOf:ji,getOwnPropertyDescriptor:qi}=Object,{freeze:R,seal:z,create:kt}=Object,{apply:wt,construct:At}=typeof Reflect<"u"&&Reflect;R||(R=f(function(e){return e},"freeze")),z||(z=f(function(e){return e},"seal")),wt||(wt=f(function(e,t){for(var i=arguments.length,a=new Array(i>2?i-2:0),l=2;l<i;l++)a[l-2]=arguments[l];return e.apply(t,a)},"apply")),At||(At=f(function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];return new e(...i)},"construct"));var Ge=M(Array.prototype.forEach),Wi=M(Array.prototype.lastIndexOf),mo=M(Array.prototype.pop),Me=M(Array.prototype.push),Zi=M(Array.prototype.splice),Qe=M(String.prototype.toLowerCase),Et=M(String.prototype.toString),St=M(String.prototype.match),Ce=M(String.prototype.replace),Ki=M(String.prototype.indexOf),Ji=M(String.prototype.trim),Y=M(Object.prototype.hasOwnProperty),N=M(RegExp.prototype.test),Re=go(TypeError);function M(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var i=arguments.length,a=new Array(i>1?i-1:0),l=1;l<i;l++)a[l-1]=arguments[l];return wt(e,t,a)}}f(M,"unapply");function go(e){return function(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return At(e,i)}}f(go,"unconstruct");function c(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qe;fo&&fo(e,null);let a=t.length;for(;a--;){let l=t[a];if(typeof l=="string"){let u=i(l);u!==l&&(Qi(t)||(t[a]=u),l=u)}e[l]=!0}return e}f(c,"addToSet");function bo(e){for(let t=0;t<e.length;t++)Y(e,t)||(e[t]=null);return e}f(bo,"cleanArray");function j(e){let t=kt(null);for(let[i,a]of po(e))Y(e,i)&&(Array.isArray(a)?t[i]=bo(a):a&&typeof a=="object"&&a.constructor===Object?t[i]=j(a):t[i]=a);return t}f(j,"clone");function ge(e,t){for(;e!==null;){let a=qi(e,t);if(a){if(a.get)return M(a.get);if(typeof a.value=="function")return M(a.value)}e=ji(e)}function i(){return null}return f(i,"fallbackValue"),i}f(ge,"lookupGetter");var yo=R(["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"]),It=R(["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"]),Lt=R(["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"]),Xi=R(["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"]),Dt=R(["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"]),$i=R(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_o=R(["#text"]),ho=R(["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"]),Mt=R(["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"]),To=R(["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"]),je=R(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ea=z(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ta=z(/<%[\w\W]*|[\w\W]*%>/gm),oa=z(/\$\{[\w\W]*/gm),ia=z(/^data-[\-\w.\u00B7-\uFFFF]+$/),aa=z(/^aria-[\-\w]+$/),xo=z(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),na=z(/^(?:\w+script|data):/i),ra=z(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),vo=z(/^html$/i),da=z(/^[a-z][.\w]*(-[.\w]+)+$/i),ko=Object.freeze({__proto__:null,ARIA_ATTR:aa,ATTR_WHITESPACE:ra,CUSTOM_ELEMENT:da,DATA_ATTR:ia,DOCTYPE_NAME:vo,ERB_EXPR:ta,IS_ALLOWED_URI:xo,IS_SCRIPT_OR_DATA:na,MUSTACHE_EXPR:ea,TMPLIT_EXPR:oa}),Ne={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},la=f(function(){return typeof window>"u"?null:window},"getGlobal"),sa=f(function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null,a="data-tt-policy-suffix";t&&t.hasAttribute(a)&&(i=t.getAttribute(a));let l="dompurify"+(i?"#"+i:"");try{return e.createPolicy(l,{createHTML(u){return u},createScriptURL(u){return u}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},"_createTrustedTypesPolicy"),wo=f(function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},"_createHooksMap");function Ct(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:la(),t=f(o=>Ct(o),"DOMPurify");if(t.version="3.3.0",t.removed=[],!e||!e.document||e.document.nodeType!==Ne.document||!e.Element)return t.isSupported=!1,t;let{document:i}=e,a=i,l=a.currentScript,{DocumentFragment:u,HTMLTemplateElement:m,Node:k,Element:T,NodeFilter:w,NamedNodeMap:te=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:oe,DOMParser:C,trustedTypes:ce}=e,ie=T.prototype,ct=ge(ie,"cloneNode"),Fe=ge(ie,"remove"),pt=ge(ie,"nextSibling"),U=ge(ie,"childNodes"),H=ge(ie,"parentNode");if(typeof m=="function"){let o=i.createElement("template");o.content&&o.content.ownerDocument&&(i=o.content.ownerDocument)}let _,B="",{implementation:ke,createNodeIterator:ft,createDocumentFragment:mt,getElementsByTagName:gt}=i,{importNode:Wa}=a,O=wo();t.isSupported=typeof po=="function"&&typeof H=="function"&&ke&&ke.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Jt,ERB_EXPR:Xt,TMPLIT_EXPR:$t,DATA_ATTR:Za,ARIA_ATTR:Ka,IS_SCRIPT_OR_DATA:Ja,ATTR_WHITESPACE:Ti,CUSTOM_ELEMENT:Xa}=ko,{IS_ALLOWED_URI:xi}=ko,A=null,vi=c({},[...yo,...It,...Lt,...Dt,..._o]),I=null,ki=c({},[...ho,...Mt,...To,...je]),x=Object.seal(kt(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}})),Ue=null,eo=null,we=Object.seal(kt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),wi=!0,to=!0,Ai=!1,Ei=!0,Ae=!1,bt=!0,pe=!1,oo=!1,io=!1,Ee=!1,yt=!1,_t=!1,Si=!0,Ii=!1,$a="user-content-",ao=!0,He=!1,Se={},Ie=null,Li=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"]),Di=null,Mi=c({},["audio","video","img","source","image","track"]),no=null,Ci=c({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ht="http://www.w3.org/1998/Math/MathML",Tt="http://www.w3.org/2000/svg",X="http://www.w3.org/1999/xhtml",Le=X,ro=!1,lo=null,en=c({},[ht,Tt,X],Et),xt=c({},["mi","mo","mn","ms","mtext"]),vt=c({},["annotation-xml"]),tn=c({},["title","style","font","a","script"]),Ye=null,on=["application/xhtml+xml","text/html"],an="text/html",E=null,De=null,nn=i.createElement("form"),Ri=f(function(o){return o instanceof RegExp||o instanceof Function},"isRegexOrFunction"),so=f(function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(De&&De===o)){if((!o||typeof o!="object")&&(o={}),o=j(o),Ye=on.indexOf(o.PARSER_MEDIA_TYPE)===-1?an:o.PARSER_MEDIA_TYPE,E=Ye==="application/xhtml+xml"?Et:Qe,A=Y(o,"ALLOWED_TAGS")?c({},o.ALLOWED_TAGS,E):vi,I=Y(o,"ALLOWED_ATTR")?c({},o.ALLOWED_ATTR,E):ki,lo=Y(o,"ALLOWED_NAMESPACES")?c({},o.ALLOWED_NAMESPACES,Et):en,no=Y(o,"ADD_URI_SAFE_ATTR")?c(j(Ci),o.ADD_URI_SAFE_ATTR,E):Ci,Di=Y(o,"ADD_DATA_URI_TAGS")?c(j(Mi),o.ADD_DATA_URI_TAGS,E):Mi,Ie=Y(o,"FORBID_CONTENTS")?c({},o.FORBID_CONTENTS,E):Li,Ue=Y(o,"FORBID_TAGS")?c({},o.FORBID_TAGS,E):j({}),eo=Y(o,"FORBID_ATTR")?c({},o.FORBID_ATTR,E):j({}),Se=Y(o,"USE_PROFILES")?o.USE_PROFILES:!1,wi=o.ALLOW_ARIA_ATTR!==!1,to=o.ALLOW_DATA_ATTR!==!1,Ai=o.ALLOW_UNKNOWN_PROTOCOLS||!1,Ei=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ae=o.SAFE_FOR_TEMPLATES||!1,bt=o.SAFE_FOR_XML!==!1,pe=o.WHOLE_DOCUMENT||!1,Ee=o.RETURN_DOM||!1,yt=o.RETURN_DOM_FRAGMENT||!1,_t=o.RETURN_TRUSTED_TYPE||!1,io=o.FORCE_BODY||!1,Si=o.SANITIZE_DOM!==!1,Ii=o.SANITIZE_NAMED_PROPS||!1,ao=o.KEEP_CONTENT!==!1,He=o.IN_PLACE||!1,xi=o.ALLOWED_URI_REGEXP||xo,Le=o.NAMESPACE||X,xt=o.MATHML_TEXT_INTEGRATION_POINTS||xt,vt=o.HTML_INTEGRATION_POINTS||vt,x=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&Ri(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(x.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&Ri(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(x.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(x.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ae&&(to=!1),yt&&(Ee=!0),Se&&(A=c({},_o),I=[],Se.html===!0&&(c(A,yo),c(I,ho)),Se.svg===!0&&(c(A,It),c(I,Mt),c(I,je)),Se.svgFilters===!0&&(c(A,Lt),c(I,Mt),c(I,je)),Se.mathMl===!0&&(c(A,Dt),c(I,To),c(I,je))),o.ADD_TAGS&&(typeof o.ADD_TAGS=="function"?we.tagCheck=o.ADD_TAGS:(A===vi&&(A=j(A)),c(A,o.ADD_TAGS,E))),o.ADD_ATTR&&(typeof o.ADD_ATTR=="function"?we.attributeCheck=o.ADD_ATTR:(I===ki&&(I=j(I)),c(I,o.ADD_ATTR,E))),o.ADD_URI_SAFE_ATTR&&c(no,o.ADD_URI_SAFE_ATTR,E),o.FORBID_CONTENTS&&(Ie===Li&&(Ie=j(Ie)),c(Ie,o.FORBID_CONTENTS,E)),ao&&(A["#text"]=!0),pe&&c(A,["html","head","body"]),A.table&&(c(A,["tbody"]),delete Ue.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw Re('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Re('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=o.TRUSTED_TYPES_POLICY,B=_.createHTML("")}else _===void 0&&(_=sa(ce,l)),_!==null&&typeof B=="string"&&(B=_.createHTML(""));R&&R(o),De=o}},"_parseConfig"),Ni=c({},[...It,...Lt,...Xi]),Oi=c({},[...Dt,...$i]),rn=f(function(o){let r=H(o);(!r||!r.tagName)&&(r={namespaceURI:Le,tagName:"template"});let n=Qe(o.tagName),b=Qe(r.tagName);return lo[o.namespaceURI]?o.namespaceURI===Tt?r.namespaceURI===X?n==="svg":r.namespaceURI===ht?n==="svg"&&(b==="annotation-xml"||xt[b]):!!Ni[n]:o.namespaceURI===ht?r.namespaceURI===X?n==="math":r.namespaceURI===Tt?n==="math"&&vt[b]:!!Oi[n]:o.namespaceURI===X?r.namespaceURI===Tt&&!vt[b]||r.namespaceURI===ht&&!xt[b]?!1:!Oi[n]&&(tn[n]||!Ni[n]):!!(Ye==="application/xhtml+xml"&&lo[o.namespaceURI]):!1},"_checkValidNamespace"),fe=f(function(o){Me(t.removed,{element:o});try{H(o).removeChild(o)}catch{Fe(o)}},"_forceRemove"),me=f(function(o,r){try{Me(t.removed,{attribute:r.getAttributeNode(o),from:r})}catch{Me(t.removed,{attribute:null,from:r})}if(r.removeAttribute(o),o==="is")if(Ee||yt)try{fe(r)}catch{}else try{r.setAttribute(o,"")}catch{}},"_removeAttribute"),Bi=f(function(o){let r=null,n=null;if(io)o="<remove></remove>"+o;else{let h=St(o,/^[\r\n\t ]+/);n=h&&h[0]}Ye==="application/xhtml+xml"&&Le===X&&(o='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+o+"</body></html>");let b=_?_.createHTML(o):o;if(Le===X)try{r=new C().parseFromString(b,Ye)}catch{}if(!r||!r.documentElement){r=ke.createDocument(Le,"template",null);try{r.documentElement.innerHTML=ro?B:b}catch{}}let L=r.body||r.documentElement;return o&&n&&L.insertBefore(i.createTextNode(n),L.childNodes[0]||null),Le===X?gt.call(r,pe?"html":"body")[0]:pe?r.documentElement:L},"_initDocument"),Pi=f(function(o){return ft.call(o.ownerDocument||o,o,w.SHOW_ELEMENT|w.SHOW_COMMENT|w.SHOW_TEXT|w.SHOW_PROCESSING_INSTRUCTION|w.SHOW_CDATA_SECTION,null)},"_createNodeIterator"),uo=f(function(o){return o instanceof oe&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof te)||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 k=="function"&&o instanceof k},"_isNode");function K(o,r,n){Ge(o,b=>{b.call(t,r,n,De)})}f(K,"_executeHooks");let Vi=f(function(o){let r=null;if(K(O.beforeSanitizeElements,o,null),uo(o))return fe(o),!0;let n=E(o.nodeName);if(K(O.uponSanitizeElement,o,{tagName:n,allowedTags:A}),bt&&o.hasChildNodes()&&!zi(o.firstElementChild)&&N(/<[/\w!]/g,o.innerHTML)&&N(/<[/\w!]/g,o.textContent)||o.nodeType===Ne.progressingInstruction||bt&&o.nodeType===Ne.comment&&N(/<[/\w]/g,o.data))return fe(o),!0;if(!(we.tagCheck instanceof Function&&we.tagCheck(n))&&(!A[n]||Ue[n])){if(!Ue[n]&&Ui(n)&&(x.tagNameCheck instanceof RegExp&&N(x.tagNameCheck,n)||x.tagNameCheck instanceof Function&&x.tagNameCheck(n)))return!1;if(ao&&!Ie[n]){let b=H(o)||o.parentNode,L=U(o)||o.childNodes;if(L&&b){let h=L.length;for(let $=h-1;$>=0;--$){let G=ct(L[$],!0);G.__removalCount=(o.__removalCount||0)+1,b.insertBefore(G,pt(o))}}}return fe(o),!0}return o instanceof T&&!rn(o)||(n==="noscript"||n==="noembed"||n==="noframes")&&N(/<\/no(script|embed|frames)/i,o.innerHTML)?(fe(o),!0):(Ae&&o.nodeType===Ne.text&&(r=o.textContent,Ge([Jt,Xt,$t],b=>{r=Ce(r,b," ")}),o.textContent!==r&&(Me(t.removed,{element:o.cloneNode()}),o.textContent=r)),K(O.afterSanitizeElements,o,null),!1)},"_sanitizeElements"),Fi=f(function(o,r,n){if(Si&&(r==="id"||r==="name")&&(n in i||n in nn))return!1;if(!(to&&!eo[r]&&N(Za,r))&&!(wi&&N(Ka,r))&&!(we.attributeCheck instanceof Function&&we.attributeCheck(r,o))){if(!I[r]||eo[r]){if(!(Ui(o)&&(x.tagNameCheck instanceof RegExp&&N(x.tagNameCheck,o)||x.tagNameCheck instanceof Function&&x.tagNameCheck(o))&&(x.attributeNameCheck instanceof RegExp&&N(x.attributeNameCheck,r)||x.attributeNameCheck instanceof Function&&x.attributeNameCheck(r,o))||r==="is"&&x.allowCustomizedBuiltInElements&&(x.tagNameCheck instanceof RegExp&&N(x.tagNameCheck,n)||x.tagNameCheck instanceof Function&&x.tagNameCheck(n))))return!1}else if(!no[r]&&!N(xi,Ce(n,Ti,""))&&!((r==="src"||r==="xlink:href"||r==="href")&&o!=="script"&&Ki(n,"data:")===0&&Di[o])&&!(Ai&&!N(Ja,Ce(n,Ti,"")))&&n)return!1}return!0},"_isValidAttribute"),Ui=f(function(o){return o!=="annotation-xml"&&St(o,Xa)},"_isBasicCustomElement"),Hi=f(function(o){K(O.beforeSanitizeAttributes,o,null);let{attributes:r}=o;if(!r||uo(o))return;let n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:I,forceKeepAttr:void 0},b=r.length;for(;b--;){let L=r[b],{name:h,namespaceURI:$,value:G}=L,Q=E(h),co=G,D=h==="value"?co:Ji(co);if(n.attrName=Q,n.attrValue=D,n.keepAttr=!0,n.forceKeepAttr=void 0,K(O.uponSanitizeAttribute,o,n),D=n.attrValue,Ii&&(Q==="id"||Q==="name")&&(me(h,o),D=$a+D),bt&&N(/((--!?|])>)|<\/(style|title|textarea)/i,D)){me(h,o);continue}if(Q==="attributename"&&St(D,"href")){me(h,o);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){me(h,o);continue}if(!Ei&&N(/\/>/i,D)){me(h,o);continue}Ae&&Ge([Jt,Xt,$t],ln=>{D=Ce(D,ln," ")});let Yi=E(o.nodeName);if(!Fi(Yi,Q,D)){me(h,o);continue}if(_&&typeof ce=="object"&&typeof ce.getAttributeType=="function"&&!$)switch(ce.getAttributeType(Yi,Q)){case"TrustedHTML":{D=_.createHTML(D);break}case"TrustedScriptURL":{D=_.createScriptURL(D);break}}if(D!==co)try{$?o.setAttributeNS($,h,D):o.setAttribute(h,D),uo(o)?fe(o):mo(t.removed)}catch{me(h,o)}}K(O.afterSanitizeAttributes,o,null)},"_sanitizeAttributes"),dn=f(function o(r){let n=null,b=Pi(r);for(K(O.beforeSanitizeShadowDOM,r,null);n=b.nextNode();)K(O.uponSanitizeShadowNode,n,null),Vi(n),Hi(n),n.content instanceof u&&o(n.content);K(O.afterSanitizeShadowDOM,r,null)},"_sanitizeShadowDOM");return t.sanitize=function(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=null,b=null,L=null,h=null;if(ro=!o,ro&&(o="<!-->"),typeof o!="string"&&!zi(o))if(typeof o.toString=="function"){if(o=o.toString(),typeof o!="string")throw Re("dirty is not a string, aborting")}else throw Re("toString is not a function");if(!t.isSupported)return o;if(oo||so(r),t.removed=[],typeof o=="string"&&(He=!1),He){if(o.nodeName){let Q=E(o.nodeName);if(!A[Q]||Ue[Q])throw Re("root node is forbidden and cannot be sanitized in-place")}}else if(o instanceof k)n=Bi("<!---->"),b=n.ownerDocument.importNode(o,!0),b.nodeType===Ne.element&&b.nodeName==="BODY"||b.nodeName==="HTML"?n=b:n.appendChild(b);else{if(!Ee&&!Ae&&!pe&&o.indexOf("<")===-1)return _&&_t?_.createHTML(o):o;if(n=Bi(o),!n)return Ee?null:_t?B:""}n&&io&&fe(n.firstChild);let $=Pi(He?o:n);for(;L=$.nextNode();)Vi(L),Hi(L),L.content instanceof u&&dn(L.content);if(He)return o;if(Ee){if(yt)for(h=mt.call(n.ownerDocument);n.firstChild;)h.appendChild(n.firstChild);else h=n;return(I.shadowroot||I.shadowrootmode)&&(h=Wa.call(a,h,!0)),h}let G=pe?n.outerHTML:n.innerHTML;return pe&&A["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&N(vo,n.ownerDocument.doctype.name)&&(G="<!DOCTYPE "+n.ownerDocument.doctype.name+">"+G),Ae&&Ge([Jt,Xt,$t],Q=>{G=Ce(G,Q," ")}),_&&_t?_.createHTML(G):G},t.setConfig=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};so(o),oo=!0},t.clearConfig=function(){De=null,oo=!1},t.isValidAttribute=function(o,r,n){De||so({});let b=E(o),L=E(r);return Fi(b,L,n)},t.addHook=function(o,r){typeof r=="function"&&Me(O[o],r)},t.removeHook=function(o,r){if(r!==void 0){let n=Wi(O[o],r);return n===-1?void 0:Zi(O[o],n,1)[0]}return mo(O[o])},t.removeHooks=function(o){O[o]=[]},t.removeAllHooks=function(){O=wo()},t}f(Ct,"createDOMPurify");var Ao=Ct();let Oe=!1;window.trustedTypes&&window.trustedTypes.createPolicy&&Ao&&(Oe=window.trustedTypes.createPolicy("GoodTubePolicy",{createHTML:e=>Ao.sanitize(e,{RETURN_TRUSTED_TYPE:!0})}));function Eo(){let e={};if(document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g,function(){function t(i){return decodeURIComponent(i.split("+").join(" "))}e[t(arguments[1])]=t(arguments[2])}),F()&&typeof e.v>"u"){let t="";window.location.href.indexOf("/watch/")!==-1?t="/watch/":t="/live/";let i=window.location.href.split(t);if(i.length===2){let a=i[1].split("?");e.v=a[a.length-1]}}return e}function p(e,t,i=399){e=e+"_new",document.cookie=e+"="+encodeURIComponent(t)+";SameSite=Lax;path=/;max-age="+i*24*60*60}function V(e){e=e+"_new";let t=document.cookie.split(";");for(let i=0;i<t.length;i++){let a=t[i].split("=");if(e==a[0].trim())return decodeURIComponent(a[1])}return null}function q(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 ua(){let e=document.createElement("style");e.textContent=`
|
|
.goodTube_hidden {
|
|
display: none !important;
|
|
}
|
|
`,document.head.appendChild(e)}function J(e){e&&!e.classList.contains("goodTube_hidden")&&e.classList.add("goodTube_hidden")}function qe(e){e&&e.classList.contains("goodTube_hidden")&&e.classList.remove("goodTube_hidden")}function F(){return window.location.href.indexOf("/watch/")!==-1||window.location.href.indexOf("/watch?")!==-1||window.location.href.indexOf("/live/")!==-1}function Rt(){if(F()){let e=document.querySelector(".video-ads"),t=document.querySelector(".ad-simple-attributed-string");return!!(e&&e.checkVisibility()||t&&t.checkVisibility())}}function We(e,t){Oe&&(t=Oe.createHTML(t)),e.innerHTML=t}function ca(e,t,i){Oe&&(i=Oe.createHTML(i)),e.insertAdjacentHTML(t,i)}let ae=!1,P=!1,d=!1,s=!1,Be=!1,Nt=!1,So=!1,Io=!1,Lo=!1,Do=!0,Mo=!1,Ot=!1,ne=!1,Ze=0,y=!1,Bt=document.hasFocus(),be=V("goodTube_shorts");be||(p("goodTube_shorts","false"),be="false");let Pe=V("goodTube_hideInfoCards");Pe||(p("goodTube_hideInfoCards","false"),Pe="false");let ze=V("goodTube_hideEndScreen");ze||(p("goodTube_hideEndScreen","false"),ze="false");let Ke=V("goodTube_hideSuggestedVideos");Ke||(p("goodTube_hideSuggestedVideos","false"),Ke="false");let Je=V("goodTube_hideComments");Je||(p("goodTube_hideComments","false"),Je="false");let Xe=V("goodTube_hideAiSummaries");Xe||(p("goodTube_hideAiSummaries","false"),Xe="false");let Ve=V("goodTube_alwaysStart");Ve||(p("goodTube_alwaysStart","false"),Ve="false");let $e=V("goodTube_blackBackground");$e||(p("goodTube_blackBackground","true"),$e="true");let W=V("goodTube_autoplay");W||(p("goodTube_autoplay","true"),W="true");let ye=V("goodTube_playbackSpeed");ye||(ye="1");let v=Eo();function pa(){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),
|
|
body:not(.goodTube_fallback) #player-full-bleed-container {
|
|
visibility: hidden !important;
|
|
}
|
|
`,e+=`
|
|
ytd-miniplayer,
|
|
.ytp-miniplayer-button {
|
|
display: none !important;
|
|
}
|
|
`,be==="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")),Ke==="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")),Je==="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")),Xe==="true"&&(e+=`
|
|
ytd-expandable-metadata-renderer[has-video-summary] {
|
|
display: none !important;
|
|
}
|
|
`,console.log("[GoodTube] AI summaries removed"));let t=document.createElement("style");t.textContent=e,document.head.appendChild(t)}function fa(){if(be==="true")return;window.location.href.indexOf("/shorts")!==-1&&!Lo&&(window.location.href="https://youtube.com",Lo=!0),document.querySelectorAll("a:not(.goodTube_hidden)").forEach(i=>{i.href.indexOf("shorts/")!==-1&&(J(i),J(i.closest("ytd-video-renderer")),J(i.closest("ytd-compact-video-renderer")),J(i.closest("ytd-rich-grid-media")))}),document.querySelectorAll("yt-chip-cloud-chip-renderer:not(.goodTube_hidden):not(.goodTube_checked), yt-tab-shape:not(.goodTube_hidden):not(.goodTube_checked), ytd-guide-entry-renderer:not(.goodTube_checked)").forEach(i=>{i.innerHTML.toLowerCase().indexOf("shorts")!==-1&&J(i),i.classList.add("goodTube_checked")})}function ma(){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(v.v)!==-1&&(t.classList.add("goodTube_timestampLink"),t.addEventListener("click",function(){let i=0,a=t.getAttribute("href").split("t=");typeof a[1]<"u"&&(i=parseFloat(a[1].replace("s",""))),Po(i)}))})}let et=setTimeout(()=>{},0);function Pt(){if(be==="true"&&window.location.href.indexOf("/shorts")!==-1||!F()){clearTimeout(et),et=setTimeout(Pt,100);return}document.querySelectorAll("video").forEach(t=>{y?!t.paused&&!t.closest("#movie_player")&&(t.muted=!0,t.volume=0,t.pause()):!t.paused&&(!Nt||!t.closest("#movie_player"))&&(t.muted=!0,t.volume=0,!Rt()||!t.closest("#movie_player")?(t.pause(),t.playbackRate=ye):(t.play(),t.playbackRate=2))}),clearTimeout(et),et=setTimeout(Pt,100)}function ga(){if(Io)return;let e=document.querySelector("#movie_player .ytp-autonav-toggle-button");e&&(e.getAttribute("aria-checked")==="true"&&q(e),Io=!0)}function ba(){document.querySelectorAll("yt-confirm-dialog-renderer").forEach(t=>{if(t.innerHTML.indexOf("Video paused. Continue watching?")!==-1){let i=t.querySelector("#confirm-button");i&&q(i)}})}function ya(e,t){if(!e||!t)return;let i=document.querySelector("ytd-watch-flexy");i&&F()&&!y&&(i.style.setProperty("--ytd-watch-flexy-width-ratio",e),i.style.setProperty("--ytd-watch-flexy-height-ratio",t))}function _a(){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 Co=setTimeout(()=>{},0);function Ro(){d=document.getElementById("movie_player");let e=!1;if(d&&typeof d.getVideoData=="function"&&(e=d.getVideoData()),!e){clearTimeout(Co),Co=setTimeout(Ro,100);return}let t="transparent";$e==="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 a=document.createElement("div");a.id="goodTube_playerWrapper",a.classList.add("goodTube_hidden"),document.body.appendChild(a);let l=document.createElement("iframe");l.src="https://en.wikipedia.org/wiki/Fuck?goodTubeProxy=1",l.setAttribute("width","100%"),l.setAttribute("height","100%"),l.setAttribute("frameborder","0"),l.setAttribute("scrolling","yes"),l.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"),l.setAttribute("referrerpolicy","strict-origin-when-cross-origin"),l.setAttribute("allowfullscreen",!0),l.style.display="none",a.appendChild(l),ae=a,P=l,Go(),setInterval(Go,100)}let zt=!1;function ha(){if(y)zt||(ot(!0),zt=!0);else{zt=!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();ae.style.top=t.top+window.scrollY+"px",ae.style.left=t.left+window.scrollX+"px",ae.style.width=e.offsetWidth+"px",ae.style.height=e.offsetHeight+"px",qe(ae)}}}let No=setTimeout(()=>{},0);function Vt(){d=document.getElementById("movie_player"),typeof d.getPlaylist=="function"&&typeof d.getPlaylistIndex=="function"&&(ne=d.getPlaylist(),Ze=d.getPlaylistIndex(),ne||(clearTimeout(No),No=setTimeout(Vt,100)))}let Oo=setTimeout(()=>{},0);function Bo(){if(re="",Ta(),!Mo){clearTimeout(Oo),Oo=setTimeout(Bo,100);return}let e=0;Ve==="false"&&typeof v.t<"u"&&(e=parseFloat(v.t.replace("s","")));let t="false";if(typeof v.i<"u"||typeof v.index<"u"||typeof v.list<"u"?(t="true",Vt()):(ne=!1,Ze=0),Do){F()||ot();let i="";e>0&&(i="&start="+e),P.contentWindow.postMessage("goodTube_src_https://www.youtube.com/embed/"+v.v+"?goodTubeEmbed=1&autoplay=1&goodTube_playlist="+t+"&goodTube_autoplay="+W+"&goodTube_playbackSpeed="+ye+"&goodTube_hideInfoCards="+Pe+"&goodTube_hideEndScreen="+ze+i,"*"),Do=!1}else P.contentWindow.postMessage("goodTube_load_"+v.v+"|||"+e+"|||"+t,"*");Ve==="false"&&Ft(),at()}let tt=setTimeout(()=>{},0);function Ft(){if(!Ot){clearTimeout(tt),tt=setTimeout(Ft,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!==v.v){clearTimeout(tt),tt=setTimeout(Ft,100);return}let i=Math.floor(d.getCurrentTime());i>=10&&Po(i,t)}function ot(e=!1){Be||(e?(d=document.getElementById("movie_player"),d&&typeof d.stopVideo=="function"&&d.stopVideo()):P.contentWindow.postMessage("goodTube_stopVideo","*")),J(ae)}function Po(e,t=""){P.contentWindow.postMessage("goodTube_skipTo_"+e+"|||"+t,"*")}function Ta(){P.contentWindow.postMessage("goodTube_pause","*")}let it=setTimeout(()=>{},0);function at(){if(!Bt||!Ot){clearTimeout(it),it=setTimeout(at,100);return}if(!y)P.contentWindow.postMessage("goodTube_play|||"+v.v,"*");else{d=document.getElementById("movie_player");let e=!1;if(d&&typeof d.getVideoData=="function"&&(e=d.getVideoData()),!e||v.v!==e.video_id){clearTimeout(it),it=setTimeout(at,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 xa(){document.addEventListener("keydown",zo,!0),document.addEventListener("keyup",zo,!0)}function zo(e){if(!F()||y)return;let t=[{key:">",code:!1,ctrl:!1,shift:!0,alt:!1},{key:"<",code:!1,ctrl:!1,shift:!0,alt:!1},{key:",",code:!1,ctrl:!1,shift:!1,alt:!1},{key:".",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"arrowleft",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"arrowright",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"j",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"l",code:!1,ctrl:!1,shift:!1,alt:!1},{key:" ",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"k",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"mediaplaypause",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"m",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"f",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"c",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"o",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"w",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"=",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"-",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"w",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"a",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"s",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"d",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"[",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"]",code:!1,ctrl:!1,shift:!1,alt:!1},{key:!1,code:"numpadadd",ctrl:!1,shift:!1,alt:!1},{key:!1,code:"numpadsubtract",ctrl:!1,shift:!1,alt:!1},{key:"0",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"1",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"2",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"3",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"4",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"5",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"6",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"7",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"8",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"9",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"i",code:!1,ctrl:!1,shift:!1,alt:!1},{key:"arrowleft",code:!1,ctrl:!0,shift:!1,alt:!1},{key:"arrowright",code:!1,ctrl:!0,shift:!1,alt:!1}],i=e.key.toLowerCase(),a=e.code.toLowerCase(),l=e.ctrlKey;e.metaKey&&(l=e.metaKey);let u=e.shiftKey,m=e.altKey,k=!1;if(t.forEach(T=>{(i===T.key||a===T.code)&&l===T.ctrl&&u===T.shift&&m===T.alt&&(k=!0)}),k){let T=e.srcElement,w=!1,te=!1;if(T&&(typeof T.nodeName<"u"&&(w=T.nodeName.toLowerCase()),typeof T.getAttribute<"u"&&(te=T.getAttribute("id"))),!T||w.indexOf("input")===-1&&w.indexOf("label")===-1&&w.indexOf("select")===-1&&w.indexOf("textarea")===-1&&w.indexOf("fieldset")===-1&&w.indexOf("legend")===-1&&w.indexOf("datalist")===-1&&w.indexOf("output")===-1&&w.indexOf("option")===-1&&w.indexOf("optgroup")===-1&&te!=="contenteditable-root"){e.preventDefault(),e.stopImmediatePropagation();let oe=e.key,C=e.keyCode;i==="mediaplaypause"&&(oe=" ",C=32),P.contentWindow.postMessage("goodTube_shortcut_"+e.type+"_"+oe+"_"+C+"_"+e.ctrlKey+"_"+e.metaKey+"_"+e.shiftKey+"_"+e.altKey,"*")}}}function Vo(e=!1){d=document.getElementById("movie_player"),d&&typeof d.nextVideo=="function"&&d.nextVideo(),console.log("[GoodTube] Playing next video...")}function va(){d=document.getElementById("movie_player"),d&&typeof d.previousVideo=="function"&&d.previousVideo(),console.log("[GoodTube] Playing previous video...")}function ka(){Vt(),(W==="true"||ne&&Ze<ne.length-1)&&Vo()}function wa(){d=document.getElementById("movie_player");let e=!1;W==="true"?e=!0:ne&&(e=!0,Ze===ne.length-1&&(e=!1)),e?P.contentWindow.postMessage("goodTube_endScreen_hide","*"):P.contentWindow.postMessage("goodTube_endScreen_show","*")}function Aa(){let e=new Date,t=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds()),a=new Date(t).toISOString().split("T")[0];V("goodTube_uniqueUserStat_"+a)||(fetch("https://jamenlyndon.com/_other/stats/users_daily.php",{referrerPolicy:"no-referrer"}),p("goodTube_uniqueUserStat_"+a,"true",2)),V("goodTube_uniqueUserStat")||(fetch("https://jamenlyndon.com/_other/stats/users_total.php",{referrerPolicy:"no-referrer"}),p("goodTube_uniqueUserStat","true"))}function Ea(){fetch("https://jamenlyndon.com/_other/stats/videos.php",{referrerPolicy:"no-referrer"})}let Fo=!1,Uo=setTimeout(()=>{},0);function Ho(e=!1){e||(window.top===window.self&&(console.log(`
|
|
==================================================
|
|
______ ________ __
|
|
/ ____/___ ____ ____/ /_ __/_ __/ /_ ___
|
|
/ / __/ __ \\/ __ \\/ __ / / / / / / / __ \\/ _ \\
|
|
/ /_/ / /_/ / /_/ / /_/ / / / / /_/ / /_/ / __/
|
|
\\____/\\____/\\____/\\____/ /_/ \\____/_____/\\___/
|
|
|
|
==================================================`),console.log("[GoodTube] Initiating...")),window.addEventListener("message",Yo),Pt(),document.addEventListener("DOMContentLoaded",Ut),(document.readyState==="interactive"||document.readyState==="complete")&&Ut()),!document.body||!document.head?(clearTimeout(Uo),Uo=setTimeout(()=>{Ho(!0)},1)):Ut()}function Ut(){Fo||(Fo=!0,Ia(),ua(),pa(),Ro(),La(),Aa(),xa(),Sa())}let nt=setTimeout(()=>{},0);function Yo(e){if(typeof e.data=="string"){if(!document.body||!document.head?(clearTimeout(nt),nt=setTimeout(()=>{Yo(e)},100)):e.data==="goodTube_proxyIframe_loaded"?Mo=!0:e.data==="goodTube_playerIframe_loaded"&&(Ot=!0,P.style.display="block"),e.data.indexOf("goodTube_pip_")!==-1)e.data.replace("goodTube_pip_","")==="true"?Be=!0:(Be=!1,typeof v.v>"u"&&ot());else if(e.data.indexOf("goodTube_playbackSpeed_")!==-1)p("goodTube_playbackSpeed",e.data.replace("goodTube_playbackSpeed_","")),ye=e.data.replace("goodTube_playbackSpeed_","");else if(e.data==="goodTube_prevVideo")va();else if(e.data==="goodTube_nextVideo")Vo();else if(e.data==="goodTube_videoEnded")ka();else if(e.data==="goodTube_theater"&&!document.fullscreenElement){let t=document.querySelector(".ytp-size-button");t&&q(t)}else if(e.data==="goodTube_autoplay_false")p("goodTube_autoplay","false"),W="false";else if(e.data==="goodTube_autoplay_true")p("goodTube_autoplay","true"),W="true";else if(e.data.indexOf("goodTube_syncMainPlayer_")!==-1&&F()&&!y){let t=parseFloat(e.data.replace("goodTube_syncMainPlayer_","")),i=document.querySelector("#movie_player video");if(d=document.getElementById("movie_player"),!d||typeof d.seekTo!="function"||typeof d.playVideo!="function"||typeof d.mute!="function"||typeof d.setVolume!="function")return;i&&Math.floor(i.currentTime)!==Math.floor(t)&&!Rt()&&(Nt=!0,d.playVideo(),d.seekTo(t-.5),d.mute(),d.setVolume(0),i.volume=0,i.muted=!0,clearTimeout(nt),nt=setTimeout(()=>{Nt=!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"),_a(),Wo(),at(),document.fullscreenElement&&(document.exitFullscreen(),window.setTimeout(()=>{let t=document.querySelector(".ytp-fullscreen-button");t&&q(t)},100));else if(e.data==="goodTube_fallback_disable")y=!1,document.body&&document.body.classList.contains("goodTube_fallback")&&document.body.classList.remove("goodTube_fallback"),document.fullscreenElement&&(document.exitFullscreen(),window.setTimeout(()=>{P.contentWindow.postMessage("goodTube_fullscreen","*")},100));else if(e.data.indexOf("goodTube_syncAspectRatio_")!==-1){let t=e.data.replace("goodTube_syncAspectRatio_","").split("_");ya(t[0],t[1])}}}function Go(){let e=So;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&&(v=Eo(),F()?(Bo(),Ea()):ot(),So=window.location.href),F()&&(wa(),ma(),y||ga(),ba(),ha(),Da()),fa()}function Sa(){let e=document.createElement("div");document.body.appendChild(e);let t=" checked";be==="true"&&(t="");let i="";Pe==="true"&&(i=" checked");let a="";ze==="true"&&(a=" checked");let l="";Ke==="true"&&(l=" checked");let u="";Je==="true"&&(u=" checked");let m="";Xe==="true"&&(m=" checked");let k="";Ve==="true"&&(k=" checked");let T="";$e==="true"&&(T=" checked"),We(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'`+a+`>
|
|
<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_alwaysStart' name='goodTube_option_alwaysStart' id='goodTube_option_alwaysStart'`+k+`>
|
|
<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'`+T+`>
|
|
<label for='goodTube_option_blackBackground'>Use a black background for the video player</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 170,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 w=document.createElement("style");w.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: 24x;
|
|
min-width: 24px;
|
|
min-height: 24px;
|
|
border-radius: 4px;
|
|
border: 1px solid #333;
|
|
overflow: hidden;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.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(w);let te=document.querySelector(".goodTube_menuButton"),oe=document.querySelector(".goodTube_menuClose");oe&&oe.addEventListener("click",()=>{te.remove(),oe.remove()});let C=document.querySelector(".goodTube_modal"),ce=document.querySelector(".goodTube_modal .goodTube_modal_overlay"),ie=document.querySelector(".goodTube_modal .goodTube_modal_closeButton");te&&te.addEventListener("click",()=>{if(C){let U=document.querySelector(".goodTube_report");U&&(U.style.display="block");let H=document.querySelector(".goodTube_successText");H&&(H.style.display="none");let _=document.querySelector(".goodTube_reportEmail");_&&(_.value="");let B=document.querySelector(".goodTube_reportText");B&&(B.value=""),C.classList.add("visible")}}),ce&&ce.addEventListener("click",()=>{C&&C.classList.contains("visible")&&C.classList.remove("visible")}),ie&&ie.addEventListener("click",()=>{C&&C.classList.contains("visible")&&C.classList.remove("visible")}),document.addEventListener("keydown",U=>{U.key.toLowerCase()==="escape"&&C&&C.classList.contains("visible")&&C.classList.remove("visible")});let ct=document.getElementById("goodTube_button_saveSettings");ct&&ct.addEventListener("click",()=>{let U=document.querySelector(".goodTube_option_shorts");U&&(U.checked?p("goodTube_shorts","false"):p("goodTube_shorts","true"));let H=document.querySelector(".goodTube_option_hideInfoCards");H&&(H.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 B=document.querySelector(".goodTube_option_hideSuggestedVideos");B&&(B.checked?p("goodTube_hideSuggestedVideos","true"):p("goodTube_hideSuggestedVideos","false"));let ke=document.querySelector(".goodTube_option_hideComments");ke&&(ke.checked?p("goodTube_hideComments","true"):p("goodTube_hideComments","false"));let ft=document.querySelector(".goodTube_option_hideAiSummaries");ft&&(ft.checked?p("goodTube_hideAiSummaries","true"):p("goodTube_hideAiSummaries","false"));let mt=document.querySelector(".goodTube_option_alwaysStart");mt&&(mt.checked?p("goodTube_alwaysStart","true"):p("goodTube_alwaysStart","false"));let gt=document.querySelector(".goodTube_option_blackBackground");gt&&(gt.checked?p("goodTube_blackBackground","true"):p("goodTube_blackBackground","false")),window.location.href=window.location.href});let Fe=document.querySelector(".goodTube_report"),pt=document.querySelector(".goodTube_successText");Fe&&pt&&Fe.addEventListener("submit",U=>{U.preventDefault(),U.stopImmediatePropagation();let H={email:document.querySelector(".goodTube_reportEmail")?.value,message:document.querySelector(".goodTube_reportText")?.value},_={method:"POST",body:JSON.stringify(H),headers:{"Content-Type":"application/json; charset=UTF-8"},referrerPolicy:"no-referrer"};fetch("https://jamenlyndon.com/_other/stats/mail.php",_).then(B=>B.text()).then(B=>{Fe.style.display="none",pt.style.display="block"})})}function Ia(){window.addEventListener("focus",()=>{Bt=!0}),window.addEventListener("blur",()=>{Bt=!1})}function La(){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;
|
|
}
|
|
`),Pe==="true"&&(t+=`
|
|
.ytp-ce-covering-overlay,
|
|
.ytp-ce-element {
|
|
display: none !important;
|
|
}
|
|
`),ze==="true"&&(t+=`
|
|
.ytp-videowall-still {
|
|
display: none !important;
|
|
}
|
|
`),e.textContent=t,document.head.appendChild(e);function i(a){if(!F()||re!=="enabled"||a.ctrlKey||a.altKey||a.metaKey)return;let l=a.key.toLowerCase(),u=a.srcElement,m=!1,k=!1;u&&(typeof u.nodeName<"u"&&(m=u.nodeName.toLowerCase()),typeof u.getAttribute<"u"&&(k=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&&k!=="contenteditable-root")&&(l===" "||l==="k"||l==="m"||l==="i")&&(a.preventDefault(),a.stopImmediatePropagation())}document.addEventListener("keydown",i,!0),document.addEventListener("keypress",i,!0),document.addEventListener("keyup",i,!0),jo()}function Da(){y&&F()?Rt()?Ma():Ca():re=""}let re="";function Ma(){let e=document.getElementById("goodTube_hideMuteAdsOverlay");if(re==="enabled"&&e)return;let t=document.querySelector("#movie_player video");t&&(t.playbackRate=2,t.muted=!0,t.volume=0,J(t));let i=document.querySelector(".ytp-chrome-bottom");i&&J(i);let a=document.getElementById("movie_player");a&&(a.style.pointerEvents="none");let l=document.querySelector(".ytp-caption-window-container");if(a&&J(l),!e){let u=document.createElement("div");u.setAttribute("id","goodTube_hideMuteAdsOverlay"),We(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)}Ht(!0),re="enabled"}function Ca(){if(re==="disabled")return;let e=document.querySelector("#movie_player video");e&&(e.playbackRate=ye,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)),qe(e));let t=document.querySelector(".ytp-chrome-bottom");t&&qe(t);let i=document.getElementById("movie_player");i&&(i.style.pointerEvents="auto");let a=document.querySelector(".ytp-caption-window-container");i&&qe(a);let l=document.getElementById("goodTube_hideMuteAdsOverlay");l&&l.remove(),Ht(),re="disabled"}let Qo=setTimeout(()=>{},0);function jo(){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),P.contentWindow.postMessage("goodTube_autoplay_"+t,"*")}):(clearTimeout(Qo),Qo=setTimeout(jo,100))}let qo=setTimeout(()=>{},0);function Wo(){let e=document.querySelector("#movie_player .ytp-autonav-toggle-button");e&&e.checkVisibility()?e.getAttribute("aria-checked")!==W&&q(e):(clearTimeout(qo),qo=setTimeout(Wo,100))}let Zo=setTimeout(()=>{},0);function Ht(e=!1){if(!(!y||!F())&&(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(Zo),Zo=setTimeout(()=>{t.currentTime===i&&Ht()},100)}}}let Ko=!1,Jo=setTimeout(()=>{},0);function Xo(e=!1){e||(window.addEventListener("message",lt),document.addEventListener("DOMContentLoaded",rt),(document.readyState==="interactive"||document.readyState==="complete")&&rt()),!document.body||!document.head?(clearTimeout(Jo),Jo=setTimeout(()=>{Xo(!0)},1)):rt()}let $o=setTimeout(()=>{},0);function rt(){s=document.getElementById("movie_player");let e=!1;if(s&&typeof s.getVideoData=="function"&&(e=s.getVideoData()),!e){clearTimeout($o),$o=setTimeout(rt,1);return}Ko||(Ko=!0,Ba(),ii(),ni(),za(),xe(),Ha(),setInterval(bi,5e3),Na(),ei(),setInterval(ei,100),window.top.postMessage("goodTube_playerIframe_loaded","*"))}function ei(){Ra(),Ua(),Oa(),Ya(),v.goodTube_playlist!=="undefined"&&v.goodTube_playlist==="true"&&ti(),Ga()}function Ra(){document.querySelector(".ytp-error")?y||(y=!0,window.top.postMessage("goodTube_fallback_enable","*"),xe(),clearTimeout(st)):y&&(y=!1,window.top.postMessage("goodTube_fallback_disable","*"),xe(),clearTimeout(st))}function Na(){typeof v.goodTube_playbackSpeed<"u"&&s&&typeof s.setPlaybackRate=="function"&&s.setPlaybackRate(parseFloat(v.goodTube_playbackSpeed)),setInterval(()=>{s&&typeof s.getPlaybackRate=="function"&&window.top.postMessage("goodTube_playbackSpeed_"+s.getPlaybackRate(),"*")},100)}function Oa(){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 Ba(){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;
|
|
}
|
|
`),v.goodTube_hideInfoCards==="true"&&(t+=`
|
|
.ytp-ce-covering-overlay,
|
|
.ytp-ce-element {
|
|
display: none !important;
|
|
}
|
|
`),v.goodTube_hideEndScreen==="true"&&(t+=`
|
|
.ytp-videowall-still {
|
|
display: none !important;
|
|
}
|
|
`),e.textContent=t,document.head.appendChild(e)}function ti(){let e=document.querySelector(".ytp-prev-button");e&&!e.classList.contains("goodTube_visible")&&e.classList.add("goodTube_visible")}function Pa(){let e=document.querySelector(".ytp-prev-button");e&&e.classList.contains("goodTube_visible")&&e.classList.remove("goodTube_visible")}let oi=setTimeout(()=>{},0);function ii(){if(!document.querySelector(".ytp-play-button")){clearTimeout(oi),oi=setTimeout(ii,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 a=document.querySelector(".ytp-size-button");a&&(a.setAttribute("data-tooltip-target-id","ytp-size-button"),a.setAttribute("data-title-no-tooltip","Theater mode (t)"),a.setAttribute("aria-label","Theater mode (t)"),a.setAttribute("title","Theater mode (t)"),a.setAttribute("data-tooltip-title","Theater mode (t)"),We(a,`
|
|
<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>
|
|
`),a.addEventListener("click",function(){window.top.postMessage("goodTube_theater","*")}));let l=document.querySelector(".ytp-subtitles-button");if(l){ca(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="'+v.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 ai=setTimeout(()=>{},0);function ni(){let e=document.querySelector("#movie_player video");if(!e){clearTimeout(ai),ai=setTimeout(ni,100);return}e.addEventListener("ended",function(){bi(!0),window.top.postMessage("goodTube_videoEnded","*")})}function za(){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&&q(i)}else t==="p"&&e.shiftKey?window.top.postMessage("goodTube_prevVideo","*"):t==="n"&&e.shiftKey&&window.top.postMessage("goodTube_nextVideo","*")})}let ee=setTimeout(()=>{},0),Z=!1,de=-1,le=!1,se=!1,ue=!1,g=document.querySelector("video"),S=document.querySelector(".goodTube_doubleSpeed");function Yt(e){let t=e.key.toLowerCase();if(t===" "||t==="k"){if(y)return;if(se){e.preventDefault(),e.stopImmediatePropagation();return}if(e.ctrlKey||e.altKey||e.metaKey||(e.preventDefault(),e.stopImmediatePropagation(),Z)||le)return;le=!0,de=s.getPlaybackRate(),clearTimeout(ee),ee=setTimeout(()=>{s.setPlaybackRate(2),s.playVideo(),S.style.display="block",Z=!0},1e3)}}function Gt(e){let t=e.key.toLowerCase();if(t===" "||t==="k"){if(y)return;if(se){e.preventDefault(),e.stopImmediatePropagation();return}if(e.ctrlKey||e.altKey||e.metaKey)return;e.preventDefault(),e.stopImmediatePropagation()}}function Qt(e){let t=e.key.toLowerCase();if(t===" "||t==="k"){if(y)return;if(se){e.preventDefault(),e.stopImmediatePropagation();return}if(e.ctrlKey||e.altKey||e.metaKey)return;clearTimeout(ee),Z?(s.setPlaybackRate(de),S.style.display="none",Z=!1):(g=document.querySelector("video"),ue=!0,q(g),ue=!1),le=!1,e.preventDefault(),e.stopImmediatePropagation()}}function _e(e){if(e.button===0&&!ue&&!y){if(le){e.preventDefault(),e.stopImmediatePropagation();return}se=!0,e.preventDefault(),e.stopImmediatePropagation(),de=s.getPlaybackRate(),clearTimeout(ee),ee=setTimeout(()=>{s.setPlaybackRate(2),s.playVideo(),S.style.display="block",Z=!0},1e3)}}function jt(e){ue||y||(e.preventDefault(),e.stopImmediatePropagation())}function he(e){if(e.button===0&&!ue&&!y){if(le){e.preventDefault(),e.stopImmediatePropagation();return}clearTimeout(ee),Z?(s.setPlaybackRate(de),S.style.display="none",Z=!1):(g=document.querySelector("video"),ue=!0,q(g),ue=!1,setTimeout(g.focus())),se=!1,e.preventDefault(),e.stopImmediatePropagation()}}function Te(e){if(!y){if(le){e.preventDefault(),e.stopImmediatePropagation();return}e.preventDefault(),e.stopImmediatePropagation(),clearTimeout(ee),Z&&(s.setPlaybackRate(de),S.style.display="none",Z=!1),se=!1}}let dt=setTimeout(()=>{},0);function xe(){if(clearTimeout(ee),Z=!1,le=!1,se=!1,g=document.querySelector("video"),S=document.querySelector(".goodTube_doubleSpeed"),y){document.removeEventListener("keydown",Yt,!0),document.removeEventListener("keypress",Gt,!0),document.removeEventListener("keyup",Qt,!0),g&&(g.removeEventListener("mousedown",_e,!0),g.removeEventListener("touchstart",_e,!0),g.removeEventListener("click",jt,!0),g.removeEventListener("mouseup",he,!0),g.removeEventListener("touchend",he,!0),g.removeEventListener("mouseout",Te,!0),g.removeEventListener("touchcancel",Te,!0)),S&&(S.style.display="none");return}if(!g){clearTimeout(dt),dt=setTimeout(xe,100);return}if(s=document.getElementById("movie_player"),!s||typeof s.getPlaybackRate!="function"||typeof s.setPlaybackRate!="function"||typeof s.playVideo!="function"){clearTimeout(dt),dt=setTimeout(xe,100);return}if(de=s.getPlaybackRate(),s.setPlaybackRate(de),S)S.style.display="none";else{S=document.createElement("div"),S.classList.add("goodTube_doubleSpeed"),S.style.position="relative",S.style.zIndex="999",S.style.display="none",We(S,`
|
|
<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(S)}document.removeEventListener("keydown",Yt,!0),document.addEventListener("keydown",Yt,!0),document.removeEventListener("keypress",Gt,!0),document.addEventListener("keypress",Gt,!0),document.removeEventListener("keyup",Qt,!0),document.addEventListener("keyup",Qt,!0),g.removeEventListener("mousedown",_e,!0),g.addEventListener("mousedown",_e,!0),g.removeEventListener("touchstart",_e,!0),g.addEventListener("touchstart",_e,!0),g.removeEventListener("click",jt,!0),g.addEventListener("click",jt,!0),g.removeEventListener("mouseup",he,!0),g.addEventListener("mouseup",he,!0),g.removeEventListener("touchend",he,!0),g.addEventListener("touchend",he,!0),g.removeEventListener("mouseout",Te,!0),g.addEventListener("mouseout",Te,!0),g.removeEventListener("touchcancel",Te,!0),g.addEventListener("touchcancel",Te,!0)}function Va(e,t){s=document.getElementById("movie_player"),s&&typeof s.loadVideoById=="function"&&typeof s.getVideoData=="function"&&(s.loadVideoById({videoId:e,startSeconds:t}),xe())}let ve=setTimeout(()=>{},0);function lt(e){if(typeof e.data!="string")return;if(!document.body||!document.head){clearTimeout(ve),ve=setTimeout(()=>{lt(e)},100);return}s=document.getElementById("movie_player");let t=!1;if(s&&typeof s.getVideoData=="function"&&(t=s.getVideoData()),!t){clearTimeout(ve),ve=setTimeout(()=>{lt(e)},100);return}if(e.data.indexOf("goodTube_load_")!==-1){let i=e.data.replace("goodTube_load_","").split("|||"),a=i[0],l=parseFloat(i[1]);i[2]==="true"?ti():Pa(),Va(a,l)}else if(e.data==="goodTube_stopVideo")Wt(),pi();else if(e.data.indexOf("goodTube_skipTo_")!==-1){let i=e.data.replace("goodTube_skipTo_","").split("|||"),a=parseFloat(i[0]),l=i[1];if(l!==""&&t.video_id!==l){clearTimeout(ve),ve=setTimeout(()=>{lt(e)},100);return}si(a)}else if(e.data==="goodTube_pause")Wt();else if(e.data.indexOf("goodTube_play|||")!==-1)gi(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 a=e.data.replace("goodTube_shortcut_","").split("_"),l=a[0],u={bubbles:!0,key:a[1],keyCode:a[2],ctrlKey:a[3]==="true",metaKey:a[4]==="true",shiftKey:a[5]==="true",altKey:a[6]==="true"};i.dispatchEvent(new KeyboardEvent(l,u))}}else e.data==="goodTube_fullscreen"?ri():e.data==="goodTube_autoplay_true"?(p("goodTube_autoplay","true"),W="true",qt("true")):e.data==="goodTube_autoplay_false"&&(p("goodTube_autoplay","false"),W="false",qt("false"))}let st=setTimeout(()=>{},0);function ri(){let e=document.querySelector(".ytp-fullscreen-button");e?q(e):(clearTimeout(st),st=setTimeout(ri,100))}let di=setTimeout(()=>{},0);function qt(e){let t=document.querySelector("#goodTube_autoplayButton");t?t.querySelector(".ytp-autonav-toggle-button").getAttribute("aria-checked")!==e&&q(t):(clearTimeout(di),di=setTimeout(()=>{qt(e)},100))}let li=setTimeout(()=>{},0);function si(e){let t=document.querySelector("video");t?t.currentTime=parseFloat(e):(clearTimeout(li),li=setTimeout(()=>{si(e)},100))}let ui=setTimeout(()=>{},0);function Wt(){let e=document.querySelector("video");e?e.pause():(clearTimeout(ui),ui=setTimeout(Wt,100))}let ci=setTimeout(()=>{},0);function pi(){let e=document.querySelector("video");e?e.muted=!0:(clearTimeout(ci),ci=setTimeout(pi,100))}let fi=setTimeout(()=>{},0);function Fa(){let e=document.querySelector("video");e?e.muted=!1:(clearTimeout(fi),fi=setTimeout(Fa,100))}let mi=setTimeout(()=>{},0);function gi(e){s=document.getElementById("movie_player");let t=!1;if(s&&typeof s.getVideoData=="function"&&(t=s.getVideoData()),!t||e!==t.video_id){clearTimeout(mi),mi=setTimeout(()=>{gi(e)},100);return}let i=document.querySelector("#movie_player video");i&&i.currentTime>=i.duration||s&&typeof s.playVideo=="function"&&s.playVideo()}function Ua(){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 bi(e=!1){let t=document.querySelector("video");if(t){let i=t.currentTime;e&&(i=t.duration),window.top.postMessage("goodTube_syncMainPlayer_"+i,"*")}}function Ha(){addEventListener("leavepictureinpicture",e=>{Be=!1,window.top.postMessage("goodTube_pip_false","*")}),addEventListener("enterpictureinpicture",e=>{Be=!0,window.top.postMessage("goodTube_pip_true","*")})}function Ya(){"mediaSession"in navigator&&(navigator.mediaSession.setActionHandler("nexttrack",()=>{window.top.postMessage("goodTube_nextVideo","*")}),navigator.mediaSession.setActionHandler("previoustrack",()=>{window.top.postMessage("goodTube_prevVideo","*")}))}function Ga(){let e=document.querySelector("video");if(e){let a=function(m,k){return k==0?m:a(k,m%k)},l=function(m,k){var T=a(m,k);return[m/T,k/T]},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 yi=!1,_i=setTimeout(()=>{},0);function hi(){window.addEventListener("message",Kt),document.addEventListener("DOMContentLoaded",Zt),(document.readyState==="interactive"||document.readyState==="complete")&&Zt(),!document.body||!document.head?(clearTimeout(_i),_i=setTimeout(hi,1)):Zt()}function Zt(){yi||(yi=!0,Qa(),ja(),window.top.postMessage("goodTube_proxyIframe_loaded","*"))}function Qa(){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 ja(){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 ut=setTimeout(()=>{},0);function Kt(e){if(typeof e.data!="string")return;(!document.body||!document.head)&&(clearTimeout(ut),ut=setTimeout(()=>{Kt(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(ut),ut=setTimeout(()=>{Kt(e)},100))}function qa(){window.top===window.self&&window.location.href.indexOf("youtube")!==-1?Ho():window.location.href.indexOf("?goodTubeProxy=1")!==-1?hi():window.location.href.indexOf("?goodTubeEmbed=1")!==-1&&Xo()}qa()})();})();
|