diff --git a/.gitignore b/.gitignore index a52cbb0..8bebe9f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ old/ +node_modules/ diff --git a/goodtube.min.js b/goodtube.min.js new file mode 100644 index 0000000..d615b4e --- /dev/null +++ b/goodtube.min.js @@ -0,0 +1,860 @@ +(()=>{var la=(de,le)=>()=>(le||de((le={exports:{}}).exports,le),le.exports);var sa=la((Pi,so)=>{(function(){"use strict";(function(e,o){typeof Pi=="object"&&typeof so<"u"?so.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self).DOMPurify=o()})(this,(function(){"use strict";let{entries:e,setPrototypeOf:o,isFrozen:i,getPrototypeOf:r,getOwnPropertyDescriptor:f}=Object,{freeze:s,seal:c,create:E}=Object,{apply:k,construct:D}=typeof Reflect<"u"&&Reflect;s||(s=function(_){return _}),c||(c=function(_){return _}),k||(k=function(_,m){for(var l=arguments.length,T=new Array(l>2?l-2:0),I=2;I1?m-1:0),T=1;T1?l-1:0),I=1;I2&&arguments[2]!==void 0?arguments[2]:be;o&&o(_,null);let T=m.length;for(;T--;){let I=m[T];if(typeof I=="string"){let Ye=l(I);Ye!==I&&(i(m)||(m[T]=Ye),I=Ye)}_[I]=!0}return _}function kn(_){for(let m=0;m<_.length;m++)S(_,m)||(_[m]=null);return _}function ee(_){let m=E(null);for(let[l,T]of e(_))S(_,l)&&(Array.isArray(T)?m[l]=kn(T):T&&typeof T=="object"&&T.constructor===Object?m[l]=ee(T):m[l]=T);return m}function Ue(_,m){for(;_!==null;){let l=f(_,m);if(l){if(l.get)return C(l.get);if(typeof l.value=="function")return C(l.value)}_=r(_)}return function(){return null}}let ii=s(["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"]),Yt=s(["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"]),Ht=s(["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"]),wn=s(["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"]),Gt=s(["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"]),An=s(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ni=s(["#text"]),ai=s(["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"]),Qt=s(["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"]),ri=s(["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"]),mt=s(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),En=c(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Sn=c(/<%[\w\W]*|[\w\W]*%>/gm),In=c(/\$\{[\w\W]*/gm),Ln=c(/^data-[\-\w.\u00B7-\uFFFF]+$/),Dn=c(/^aria-[\-\w]+$/),di=c(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Mn=c(/^(?:\w+script|data):/i),Cn=c(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),li=c(/^html$/i),Rn=c(/^[a-z][.\w]*(-[.\w]+)+$/i);var si=Object.freeze({__proto__:null,ARIA_ATTR:Dn,ATTR_WHITESPACE:Cn,CUSTOM_ELEMENT:Rn,DATA_ATTR:Ln,DOCTYPE_NAME:li,ERB_EXPR:Sn,IS_ALLOWED_URI:di,IS_SCRIPT_OR_DATA:Mn,MUSTACHE_EXPR:En,TMPLIT_EXPR:In});let Nn=1,On=3,Bn=7,Pn=8,zn=9,Vn=function(){return typeof window>"u"?null:window};var Fn=(function _(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Vn(),l=t=>_(t);if(l.version="3.3.0",l.removed=[],!m||!m.document||m.document.nodeType!==zn||!m.Element)return l.isSupported=!1,l;let{document:T}=m,I=T,Ye=I.currentScript,{DocumentFragment:ui,HTMLTemplateElement:Un,Node:jt,Element:ci,NodeFilter:He,NamedNodeMap:Yn=m.NamedNodeMap||m.MozNamedAttrMap,HTMLFormElement:Hn,DOMParser:Gn,trustedTypes:gt}=m,Ge=ci.prototype,Qn=Ue(Ge,"cloneNode"),jn=Ue(Ge,"remove"),qn=Ue(Ge,"nextSibling"),Wn=Ue(Ge,"childNodes"),bt=Ue(Ge,"parentNode");if(typeof Un=="function"){let t=T.createElement("template");t.content&&t.content.ownerDocument&&(T=t.content.ownerDocument)}let V,Qe="",{implementation:qt,createNodeIterator:Zn,createDocumentFragment:Kn,getElementsByTagName:Jn}=T,{importNode:Xn}=I,F={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};l.isSupported=typeof e=="function"&&typeof bt=="function"&&qt&&qt.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Wt,ERB_EXPR:Zt,TMPLIT_EXPR:Kt,DATA_ATTR:$n,ARIA_ATTR:ea,IS_SCRIPT_OR_DATA:ta,ATTR_WHITESPACE:fi,CUSTOM_ELEMENT:oa}=si,{IS_ALLOWED_URI:pi}=si,R=null,mi=g({},[...ii,...Yt,...Ht,...Gt,...ni]),B=null,gi=g({},[...ai,...Qt,...ri,...mt]),w=Object.seal(E(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}})),je=null,Jt=null,Ie=Object.seal(E(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),bi=!0,Xt=!0,yi=!1,_i=!0,Le=!1,yt=!0,_e=!1,$t=!1,eo=!1,De=!1,_t=!1,ht=!1,hi=!0,Ti=!1,to=!0,qe=!1,Me={},Ce=null,xi=g({},["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"]),vi=null,ki=g({},["audio","video","img","source","image","track"]),oo=null,wi=g({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Tt="http://www.w3.org/1998/Math/MathML",xt="http://www.w3.org/2000/svg",te="http://www.w3.org/1999/xhtml",Re=te,io=!1,no=null,ia=g({},[Tt,xt,te],ye),vt=g({},["mi","mo","mn","ms","mtext"]),kt=g({},["annotation-xml"]),na=g({},["title","style","font","a","script"]),We=null,aa=["application/xhtml+xml","text/html"],N=null,Ne=null,ra=T.createElement("form"),Ai=function(t){return t instanceof RegExp||t instanceof Function},ao=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!Ne||Ne!==t){if(t&&typeof t=="object"||(t={}),t=ee(t),We=aa.indexOf(t.PARSER_MEDIA_TYPE)===-1?"text/html":t.PARSER_MEDIA_TYPE,N=We==="application/xhtml+xml"?ye:be,R=S(t,"ALLOWED_TAGS")?g({},t.ALLOWED_TAGS,N):mi,B=S(t,"ALLOWED_ATTR")?g({},t.ALLOWED_ATTR,N):gi,no=S(t,"ALLOWED_NAMESPACES")?g({},t.ALLOWED_NAMESPACES,ye):ia,oo=S(t,"ADD_URI_SAFE_ATTR")?g(ee(wi),t.ADD_URI_SAFE_ATTR,N):wi,vi=S(t,"ADD_DATA_URI_TAGS")?g(ee(ki),t.ADD_DATA_URI_TAGS,N):ki,Ce=S(t,"FORBID_CONTENTS")?g({},t.FORBID_CONTENTS,N):xi,je=S(t,"FORBID_TAGS")?g({},t.FORBID_TAGS,N):ee({}),Jt=S(t,"FORBID_ATTR")?g({},t.FORBID_ATTR,N):ee({}),Me=!!S(t,"USE_PROFILES")&&t.USE_PROFILES,bi=t.ALLOW_ARIA_ATTR!==!1,Xt=t.ALLOW_DATA_ATTR!==!1,yi=t.ALLOW_UNKNOWN_PROTOCOLS||!1,_i=t.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Le=t.SAFE_FOR_TEMPLATES||!1,yt=t.SAFE_FOR_XML!==!1,_e=t.WHOLE_DOCUMENT||!1,De=t.RETURN_DOM||!1,_t=t.RETURN_DOM_FRAGMENT||!1,ht=t.RETURN_TRUSTED_TYPE||!1,eo=t.FORCE_BODY||!1,hi=t.SANITIZE_DOM!==!1,Ti=t.SANITIZE_NAMED_PROPS||!1,to=t.KEEP_CONTENT!==!1,qe=t.IN_PLACE||!1,pi=t.ALLOWED_URI_REGEXP||di,Re=t.NAMESPACE||te,vt=t.MATHML_TEXT_INTEGRATION_POINTS||vt,kt=t.HTML_INTEGRATION_POINTS||kt,w=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&Ai(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(w.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&Ai(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(w.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(w.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Le&&(Xt=!1),_t&&(De=!0),Me&&(R=g({},ni),B=[],Me.html===!0&&(g(R,ii),g(B,ai)),Me.svg===!0&&(g(R,Yt),g(B,Qt),g(B,mt)),Me.svgFilters===!0&&(g(R,Ht),g(B,Qt),g(B,mt)),Me.mathMl===!0&&(g(R,Gt),g(B,ri),g(B,mt))),t.ADD_TAGS&&(typeof t.ADD_TAGS=="function"?Ie.tagCheck=t.ADD_TAGS:(R===mi&&(R=ee(R)),g(R,t.ADD_TAGS,N))),t.ADD_ATTR&&(typeof t.ADD_ATTR=="function"?Ie.attributeCheck=t.ADD_ATTR:(B===gi&&(B=ee(B)),g(B,t.ADD_ATTR,N))),t.ADD_URI_SAFE_ATTR&&g(oo,t.ADD_URI_SAFE_ATTR,N),t.FORBID_CONTENTS&&(Ce===xi&&(Ce=ee(Ce)),g(Ce,t.FORBID_CONTENTS,N)),to&&(R["#text"]=!0),_e&&g(R,["html","head","body"]),R.table&&(g(R,["tbody"]),delete je.tbody),t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!="function")throw ae('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ae('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');V=t.TRUSTED_TYPES_POLICY,Qe=V.createHTML("")}else V===void 0&&(V=(function(a,n){if(typeof a!="object"||typeof a.createPolicy!="function")return null;let b=null,h="data-tt-policy-suffix";n&&n.hasAttribute(h)&&(b=n.getAttribute(h));let p="dompurify"+(b?"#"+b:"");try{return a.createPolicy(p,{createHTML:L=>L,createScriptURL:L=>L})}catch{return console.warn("TrustedTypes policy "+p+" could not be created."),null}})(gt,Ye)),V!==null&&typeof Qe=="string"&&(Qe=V.createHTML(""));s&&s(t),Ne=t}},Ei=g({},[...Yt,...Ht,...wn]),Si=g({},[...Gt,...An]),K=function(t){ne(l.removed,{element:t});try{bt(t).removeChild(t)}catch{jn(t)}},he=function(t,a){try{ne(l.removed,{attribute:a.getAttributeNode(t),from:a})}catch{ne(l.removed,{attribute:null,from:a})}if(a.removeAttribute(t),t==="is")if(De||_t)try{K(a)}catch{}else try{a.setAttribute(t,"")}catch{}},Ii=function(t){let a=null,n=null;if(eo)t=""+t;else{let p=Se(t,/^[\r\n\t ]+/);n=p&&p[0]}We==="application/xhtml+xml"&&Re===te&&(t=''+t+"");let b=V?V.createHTML(t):t;if(Re===te)try{a=new Gn().parseFromString(b,We)}catch{}if(!a||!a.documentElement){a=qt.createDocument(Re,"template",null);try{a.documentElement.innerHTML=io?Qe:b}catch{}}let h=a.body||a.documentElement;return t&&n&&h.insertBefore(T.createTextNode(n),h.childNodes[0]||null),Re===te?Jn.call(a,_e?"html":"body")[0]:_e?a.documentElement:h},Li=function(t){return Zn.call(t.ownerDocument||t,t,He.SHOW_ELEMENT|He.SHOW_COMMENT|He.SHOW_TEXT|He.SHOW_PROCESSING_INSTRUCTION|He.SHOW_CDATA_SECTION,null)},ro=function(t){return t instanceof Hn&&(typeof t.nodeName!="string"||typeof t.textContent!="string"||typeof t.removeChild!="function"||!(t.attributes instanceof Yn)||typeof t.removeAttribute!="function"||typeof t.setAttribute!="function"||typeof t.namespaceURI!="string"||typeof t.insertBefore!="function"||typeof t.hasChildNodes!="function")},Di=function(t){return typeof jt=="function"&&t instanceof jt};function oe(t,a,n){Q(t,(b=>{b.call(l,a,n,Ne)}))}let Mi=function(t){let a=null;if(oe(F.beforeSanitizeElements,t,null),ro(t))return K(t),!0;let n=N(t.nodeName);if(oe(F.uponSanitizeElement,t,{tagName:n,allowedTags:R}),yt&&t.hasChildNodes()&&!Di(t.firstElementChild)&&M(/<[/\w!]/g,t.innerHTML)&&M(/<[/\w!]/g,t.textContent)||t.nodeType===Bn||yt&&t.nodeType===Pn&&M(/<[/\w]/g,t.data))return K(t),!0;if(!(Ie.tagCheck instanceof Function&&Ie.tagCheck(n))&&(!R[n]||je[n])){if(!je[n]&&Ri(n)&&(w.tagNameCheck instanceof RegExp&&M(w.tagNameCheck,n)||w.tagNameCheck instanceof Function&&w.tagNameCheck(n)))return!1;if(to&&!Ce[n]){let b=bt(t)||t.parentNode,h=Wn(t)||t.childNodes;if(h&&b)for(let p=h.length-1;p>=0;--p){let L=Qn(h[p],!0);L.__removalCount=(t.__removalCount||0)+1,b.insertBefore(L,qn(t))}}return K(t),!0}return t instanceof ci&&!(function(b){let h=bt(b);h&&h.tagName||(h={namespaceURI:Re,tagName:"template"});let p=be(b.tagName),L=be(h.tagName);return!!no[b.namespaceURI]&&(b.namespaceURI===xt?h.namespaceURI===te?p==="svg":h.namespaceURI===Tt?p==="svg"&&(L==="annotation-xml"||vt[L]):!!Ei[p]:b.namespaceURI===Tt?h.namespaceURI===te?p==="math":h.namespaceURI===xt?p==="math"&&kt[L]:!!Si[p]:b.namespaceURI===te?!(h.namespaceURI===xt&&!kt[L])&&!(h.namespaceURI===Tt&&!vt[L])&&!Si[p]&&(na[p]||!Ei[p]):!(We!=="application/xhtml+xml"||!no[b.namespaceURI]))})(t)?(K(t),!0):n!=="noscript"&&n!=="noembed"&&n!=="noframes"||!M(/<\/no(script|embed|frames)/i,t.innerHTML)?(Le&&t.nodeType===On&&(a=t.textContent,Q([Wt,Zt,Kt],(b=>{a=z(a,b," ")})),t.textContent!==a&&(ne(l.removed,{element:t.cloneNode()}),t.textContent=a)),oe(F.afterSanitizeElements,t,null),!1):(K(t),!0)},Ci=function(t,a,n){if(hi&&(a==="id"||a==="name")&&(n in T||n in ra))return!1;if(!(Xt&&!Jt[a]&&M($n,a))){if(!(bi&&M(ea,a))){if(!(Ie.attributeCheck instanceof Function&&Ie.attributeCheck(a,t))){if(!B[a]||Jt[a]){if(!(Ri(t)&&(w.tagNameCheck instanceof RegExp&&M(w.tagNameCheck,t)||w.tagNameCheck instanceof Function&&w.tagNameCheck(t))&&(w.attributeNameCheck instanceof RegExp&&M(w.attributeNameCheck,a)||w.attributeNameCheck instanceof Function&&w.attributeNameCheck(a,t))||a==="is"&&w.allowCustomizedBuiltInElements&&(w.tagNameCheck instanceof RegExp&&M(w.tagNameCheck,n)||w.tagNameCheck instanceof Function&&w.tagNameCheck(n))))return!1}else if(!oo[a]){if(!M(pi,z(n,fi,""))){if((a!=="src"&&a!=="xlink:href"&&a!=="href"||t==="script"||X(n,"data:")!==0||!vi[t])&&!(yi&&!M(ta,z(n,fi,"")))){if(n)return!1}}}}}}return!0},Ri=function(t){return t!=="annotation-xml"&&Se(t,oa)},Ni=function(t){oe(F.beforeSanitizeAttributes,t,null);let{attributes:a}=t;if(!a||ro(t))return;let n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:B,forceKeepAttr:void 0},b=a.length;for(;b--;){let h=a[b],{name:p,namespaceURI:L,value:re}=h,j=N(p),lo=re,P=p==="value"?lo:$(lo);if(n.attrName=j,n.attrValue=P,n.keepAttr=!0,n.forceKeepAttr=void 0,oe(F.uponSanitizeAttribute,t,n),P=n.attrValue,!Ti||j!=="id"&&j!=="name"||(he(p,t),P="user-content-"+P),yt&&M(/((--!?|])>)|<\/(style|title|textarea)/i,P)){he(p,t);continue}if(j==="attributename"&&Se(P,"href")){he(p,t);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){he(p,t);continue}if(!_i&&M(/\/>/i,P)){he(p,t);continue}Le&&Q([Wt,Zt,Kt],(Bi=>{P=z(P,Bi," ")}));let Oi=N(t.nodeName);if(Ci(Oi,j,P)){if(V&&typeof gt=="object"&&typeof gt.getAttributeType=="function"&&!L)switch(gt.getAttributeType(Oi,j)){case"TrustedHTML":P=V.createHTML(P);break;case"TrustedScriptURL":P=V.createScriptURL(P)}if(P!==lo)try{L?t.setAttributeNS(L,p,P):t.setAttribute(p,P),ro(t)?K(t):U(l.removed)}catch{he(p,t)}}else he(p,t)}oe(F.afterSanitizeAttributes,t,null)},da=function t(a){let n=null,b=Li(a);for(oe(F.beforeSanitizeShadowDOM,a,null);n=b.nextNode();)oe(F.uponSanitizeShadowNode,n,null),Mi(n),Ni(n),n.content instanceof ui&&t(n.content);oe(F.afterSanitizeShadowDOM,a,null)};return l.sanitize=function(t){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=null,b=null,h=null,p=null;if(io=!t,io&&(t=""),typeof t!="string"&&!Di(t)){if(typeof t.toString!="function")throw ae("toString is not a function");if(typeof(t=t.toString())!="string")throw ae("dirty is not a string, aborting")}if(!l.isSupported)return t;if($t||ao(a),l.removed=[],typeof t=="string"&&(qe=!1),qe){if(t.nodeName){let j=N(t.nodeName);if(!R[j]||je[j])throw ae("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof jt)n=Ii(""),b=n.ownerDocument.importNode(t,!0),b.nodeType===Nn&&b.nodeName==="BODY"||b.nodeName==="HTML"?n=b:n.appendChild(b);else{if(!De&&!Le&&!_e&&t.indexOf("<")===-1)return V&&ht?V.createHTML(t):t;if(n=Ii(t),!n)return De?null:ht?Qe:""}n&&eo&&K(n.firstChild);let L=Li(qe?t:n);for(;h=L.nextNode();)Mi(h),Ni(h),h.content instanceof ui&&da(h.content);if(qe)return t;if(De){if(_t)for(p=Kn.call(n.ownerDocument);n.firstChild;)p.appendChild(n.firstChild);else p=n;return(B.shadowroot||B.shadowrootmode)&&(p=Xn.call(I,p,!0)),p}let re=_e?n.outerHTML:n.innerHTML;return _e&&R["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&M(li,n.ownerDocument.doctype.name)&&(re=" +`+re),Le&&Q([Wt,Zt,Kt],(j=>{re=z(re,j," ")})),V&&ht?V.createHTML(re):re},l.setConfig=function(){ao(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),$t=!0},l.clearConfig=function(){Ne=null,$t=!1},l.isValidAttribute=function(t,a,n){Ne||ao({});let b=N(t),h=N(a);return Ci(b,h,n)},l.addHook=function(t,a){typeof a=="function"&&ne(F[t],a)},l.removeHook=function(t,a){if(a!==void 0){let n=Ve(F[t],a);return n===-1?void 0:pt(F[t],n,1)[0]}return U(F[t])},l.removeHooks=function(t){F[t]=[]},l.removeAllHooks=function(){F={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},l})();return Fn}));let de=!1;window.trustedTypes&&window.trustedTypes.createPolicy&&DOMPurify&&(de=window.trustedTypes.createPolicy("GoodTubePolicy",{createHTML:e=>DOMPurify.sanitize(e,{RETURN_TRUSTED_TYPE:!1})}));function le(){let e={};if(document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g,function(){function o(i){return decodeURIComponent(i.split("+").join(" "))}e[o(arguments[1])]=o(arguments[2])}),G()&&typeof e.v>"u"){let o="";window.location.href.indexOf("/watch/")!==-1?o="/watch/":o="/live/";let i=window.location.href.split(o);if(i.length===2){let r=i[1].split("?");e.v=r[r.length-1]}}return e}function y(e,o,i=399){e=e+"_new",document.cookie=e+"="+encodeURIComponent(o)+";SameSite=Lax;path=/;max-age="+i*24*60*60}function H(e){e=e+"_new";let o=document.cookie.split(";");for(let i=0;i #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; + } + `,Te==="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")),Xe==="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")),$e==="true"&&(e+=` + ytd-item-section-renderer.ytd-comments, + #comments-button, + #shorts-panel-container ytd-engagement-panel-section-list-renderer { + display: none !important; + } + `,console.log("[GoodTube] Comments removed")),et==="true"&&(e+=` + ytd-expandable-metadata-renderer[has-video-summary] { + display: none !important; + } + `,console.log("[GoodTube] AI summaries removed"));let o=document.createElement("style");o.textContent=e,document.head.appendChild(o)}function Ui(){if(Te==="true")return;window.location.href.indexOf("/shorts")!==-1&&!fo&&(window.location.href="https://youtube.com",fo=!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 Yi(){document.querySelectorAll("#description a, ytd-comments .yt-core-attributed-string a, ytm-expandable-video-description-body-renderer a, .comment-content a").forEach(o=>{!o.classList.contains("goodTube_timestampLink")&&o.getAttribute("href")&&o.getAttribute("href").indexOf(A.v)!==-1&&(o.classList.add("goodTube_timestampLink"),o.addEventListener("click",function(){let i=0,r=o.getAttribute("href").split("t=");typeof r[1]<"u"&&(i=parseFloat(r[1].replace("s",""))),To(i)}))})}let ot=setTimeout(()=>{},0);function It(){if(Te==="true"&&window.location.href.indexOf("/shorts")!==-1||!G()){clearTimeout(ot),ot=setTimeout(It,100);return}document.querySelectorAll("video").forEach(o=>{v?!o.paused&&!o.closest("#movie_player")&&(o.muted=!0,o.volume=0,o.pause()):!o.paused&&(!At||!o.closest("#movie_player"))&&(o.muted=!0,o.volume=0,!wt()||!o.closest("#movie_player")?(o.pause(),o.playbackRate=xe):(o.play(),o.playbackRate=2))}),clearTimeout(ot),ot=setTimeout(It,100)}function Hi(){if(co)return;let e=document.querySelector("#movie_player .ytp-autonav-toggle-button");e&&(e.getAttribute("aria-checked")==="true"&&q(e),co=!0)}function Gi(){document.querySelectorAll("yt-confirm-dialog-renderer").forEach(o=>{if(o.innerHTML.indexOf("Video paused. Continue watching?")!==-1){let i=o.querySelector("#confirm-button");i&&q(i)}})}function Qi(e,o){if(!e||!o)return;let i=document.querySelector("ytd-watch-flexy");i&&G()&&!v&&(i.style.setProperty("--ytd-watch-flexy-width-ratio",e),i.style.setProperty("--ytd-watch-flexy-height-ratio",o))}function ji(){let e=document.querySelector("ytd-watch-flexy");e&&(e.style.removeProperty("--ytd-watch-flexy-width-ratio"),e.style.removeProperty("--ytd-watch-flexy-height-ratio"))}let go=setTimeout(()=>{},0);function bo(){d=document.getElementById("movie_player");let e=!1;if(d&&typeof d.getVideoData=="function"&&(e=d.getVideoData()),!e){clearTimeout(go),go=setTimeout(bo,100);return}let o="transparent";tt==="true"&&(o="#000000");let i=document.createElement("style");i.textContent=` + /* Player wrapper */ + #goodTube_playerWrapper { + border-radius: 12px; + background: `+o+`; + 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 r=document.createElement("div");r.id="goodTube_playerWrapper",r.classList.add("goodTube_hidden"),document.body.appendChild(r);let f=document.createElement("iframe");f.src="https://en.wikipedia.org/wiki/Fuck?goodTubeProxy=1",f.setAttribute("width","100%"),f.setAttribute("height","100%"),f.setAttribute("frameborder","0"),f.setAttribute("scrolling","yes"),f.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"),f.setAttribute("referrerpolicy","strict-origin-when-cross-origin"),f.setAttribute("allowfullscreen",!0),f.style.display="none",r.appendChild(f),se=r,Y=f,So(),setInterval(So,100)}let Lt=!1;function qi(){if(v)Lt||(nt(!0),Lt=!0);else{Lt=!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 o=e.getBoundingClientRect();se.style.top=o.top+window.scrollY+"px",se.style.left=o.left+window.scrollX+"px",se.style.width=e.offsetWidth+"px",se.style.height=e.offsetHeight+"px",Ze(se)}}}let yo=setTimeout(()=>{},0);function Dt(){d=document.getElementById("movie_player"),typeof d.getPlaylist=="function"&&typeof d.getPlaylistIndex=="function"&&(ue=d.getPlaylist(),Je=d.getPlaylistIndex(),ue||(clearTimeout(yo),yo=setTimeout(Dt,100)))}let _o=setTimeout(()=>{},0);function ho(){if(ce="",Wi(),!mo){clearTimeout(_o),_o=setTimeout(ho,100);return}let e=0;ze==="false"&&typeof A.t<"u"&&(e=parseFloat(A.t.replace("s","")));let o="false";if(typeof A.i<"u"||typeof A.index<"u"||typeof A.list<"u"?(o="true",Dt()):(ue=!1,Je=0),po){G()||nt();let i="";e>0&&(i="&start="+e),Y.contentWindow.postMessage("goodTube_src_https://www.youtube.com/embed/"+A.v+"?goodTubeEmbed=1&autoplay=1&goodTube_playlist="+o+"&goodTube_autoplay="+W+"&goodTube_playbackSpeed="+xe+"&goodTube_hideInfoCards="+Be+"&goodTube_hideEndScreen="+Pe+i,"*"),po=!1}else Y.contentWindow.postMessage("goodTube_load_"+A.v+"|||"+e+"|||"+o,"*");ze==="false"&&Mt(),rt()}let it=setTimeout(()=>{},0);function Mt(){if(!Et){clearTimeout(it),it=setTimeout(Mt,100);return}d=document.getElementById("movie_player");let e=!1,o=!1;if(d&&typeof d.getVideoData=="function"&&typeof d.getCurrentTime=="function"&&(e=d.getVideoData(),o=e.video_id),!e||!o||o!==A.v){clearTimeout(it),it=setTimeout(Mt,100);return}let i=Math.floor(d.getCurrentTime());i>=10&&To(i,o)}function nt(e=!1){Oe||(e?(d=document.getElementById("movie_player"),d&&typeof d.stopVideo=="function"&&d.stopVideo()):Y.contentWindow.postMessage("goodTube_stopVideo","*")),J(se)}function To(e,o=""){Y.contentWindow.postMessage("goodTube_skipTo_"+e+"|||"+o,"*")}function Wi(){Y.contentWindow.postMessage("goodTube_pause","*")}let at=setTimeout(()=>{},0);function rt(){if(!St||!Et){clearTimeout(at),at=setTimeout(rt,100);return}if(!v)Y.contentWindow.postMessage("goodTube_play|||"+A.v,"*");else{d=document.getElementById("movie_player");let e=!1;if(d&&typeof d.getVideoData=="function"&&(e=d.getVideoData()),!e||A.v!==e.video_id){clearTimeout(at),at=setTimeout(rt,100);return}let o=document.querySelector("#movie_player video");if(o&&o.currentTime>=o.duration)return;d&&typeof d.playVideo=="function"&&setTimeout(()=>{d.playVideo()},100)}}function Zi(){document.addEventListener("keydown",xo,!0),document.addEventListener("keyup",xo,!0)}function xo(e){if(!G()||v)return;let o=[{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:"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(),r=e.code.toLowerCase(),f=e.ctrlKey;e.metaKey&&(f=e.metaKey);let s=e.shiftKey,c=e.altKey,E=!1;if(o.forEach(k=>{(i===k.key||r===k.code)&&f===k.ctrl&&s===k.shift&&c===k.alt&&(E=!0)}),E){let k=e.srcElement,D=!1,Q=!1;k&&(typeof k.nodeName<"u"&&(D=k.nodeName.toLowerCase()),typeof k.getAttribute<"u"&&(Q=k.getAttribute("id"))),(!k||D.indexOf("input")===-1&&D.indexOf("label")===-1&&D.indexOf("select")===-1&&D.indexOf("textarea")===-1&&D.indexOf("fieldset")===-1&&D.indexOf("legend")===-1&&D.indexOf("datalist")===-1&&D.indexOf("output")===-1&&D.indexOf("option")===-1&&D.indexOf("optgroup")===-1&&Q!=="contenteditable-root")&&(e.preventDefault(),e.stopImmediatePropagation(),Y.contentWindow.postMessage("goodTube_shortcut_"+e.type+"_"+e.key+"_"+e.keyCode+"_"+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 Ki(){d=document.getElementById("movie_player"),d&&typeof d.previousVideo=="function"&&d.previousVideo(),console.log("[GoodTube] Playing previous video...")}function Ji(){Dt(),(W==="true"||ue&&Je{},0);function Ao(e=!1){e||(window.top===window.self&&(console.log(` +================================================== + ______ ________ __ + / ____/___ ____ ____/ /_ __/_ __/ /_ ___ + / / __/ __ \\/ __ \\/ __ / / / / / / / __ \\/ _ \\ + / /_/ / /_/ / /_/ / /_/ / / / / /_/ / /_/ / __/ + \\____/\\____/\\____/\\____/ /_/ \\____/_____/\\___/ + +==================================================`),console.log("[GoodTube] Initiating...")),window.addEventListener("message",Eo),It(),document.addEventListener("DOMContentLoaded",Ct),(document.readyState==="interactive"||document.readyState==="complete")&&Ct()),!document.body||!document.head?(clearTimeout(wo),wo=setTimeout(()=>{Ao(!0)},1)):Ct()}function Ct(){ko||(ko=!0,on(),zi(),Fi(),bo(),nn(),$i(),Zi(),tn())}let dt=setTimeout(()=>{},0);function Eo(e){if(typeof e.data=="string"){if(!document.body||!document.head?(clearTimeout(dt),dt=setTimeout(()=>{Eo(e)},100)):e.data==="goodTube_proxyIframe_loaded"?mo=!0:e.data==="goodTube_playerIframe_loaded"&&(Et=!0,Y.style.display="block"),e.data.indexOf("goodTube_pip_")!==-1)e.data.replace("goodTube_pip_","")==="true"?Oe=!0:(Oe=!1,typeof A.v>"u"&&nt());else if(e.data.indexOf("goodTube_playbackSpeed_")!==-1)y("goodTube_playbackSpeed",e.data.replace("goodTube_playbackSpeed_","")),xe=e.data.replace("goodTube_playbackSpeed_","");else if(e.data==="goodTube_prevVideo")Ki();else if(e.data==="goodTube_nextVideo")vo();else if(e.data==="goodTube_videoEnded")Ji();else if(e.data==="goodTube_theater"&&!document.fullscreenElement){let o=document.querySelector(".ytp-size-button");o&&q(o)}else if(e.data==="goodTube_autoplay_false")y("goodTube_autoplay","false"),W="false";else if(e.data==="goodTube_autoplay_true")y("goodTube_autoplay","true"),W="true";else if(e.data.indexOf("goodTube_syncMainPlayer_")!==-1&&G()&&!v){let o=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(o)&&!wt()&&(At=!0,d.playVideo(),d.seekTo(o-.5),d.mute(),d.setVolume(0),i.volume=0,i.muted=!0,clearTimeout(dt),dt=setTimeout(()=>{At=!1},1e3))}else if(e.data==="goodTube_fallback_enable")v=!0,document.body&&!document.body.classList.contains("goodTube_fallback")&&document.body.classList.add("goodTube_fallback"),ji(),Mo(),rt(),document.fullscreenElement&&(document.exitFullscreen(),window.setTimeout(()=>{let o=document.querySelector(".ytp-fullscreen-button");o&&q(o)},100));else if(e.data==="goodTube_fallback_disable")v=!1,document.body&&document.body.classList.contains("goodTube_fallback")&&document.body.classList.remove("goodTube_fallback"),document.fullscreenElement&&(document.exitFullscreen(),window.setTimeout(()=>{Y.contentWindow.postMessage("goodTube_fullscreen","*")},100));else if(e.data.indexOf("goodTube_syncAspectRatio_")!==-1){let o=e.data.replace("goodTube_syncAspectRatio_","").split("_");Qi(o[0],o[1])}}}function So(){let e=uo;e&&(e=e.split("#")[0],e=e.split("index=")[0]);let o=window.location.href;o&&(o=o.split("#")[0],o=o.split("index=")[0]),e!==o&&(A=le(),G()?(ho(),en()):nt(),uo=window.location.href),G()&&(Xi(),Yi(),v||Hi(),Gi(),qi(),an()),Ui()}function tn(){let e=document.createElement("div");document.body.appendChild(e);let o=" checked";Te==="true"&&(o="");let i="";Be==="true"&&(i=" checked");let r="";Pe==="true"&&(r=" checked");let f="";Xe==="true"&&(f=" checked");let s="";$e==="true"&&(s=" checked");let c="";et==="true"&&(c=" checked");let E="";ze==="true"&&(E=" checked");let k="";tt==="true"&&(k=" checked"),Ke(e,` + + + + + + + + +
+
+ +
+ + +
Settings
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+ + +
Make a donation
+
+
+
+ This adblocker is 100% free to use and always will be.
+ It has helped over 170,000 people remove the unbearable ads from Youtube.

+
+ 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).
+
+ 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.
+
+ Update -
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.
\u{1F64F}\u{1F3FC} +
+ Donate now +
+
+ + +
FAQs
+
+
+ How can I share this with friends?
+ You can send them this link. It has all of the install instructions.
+
+ Do I need to manually update this?
+ Nope, updates are pushed to you automatically so you don't have to do anything to use the latest version.
+
+ Playlists skip to the next video every few seconds
+ 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.
+
+ I can't use the miniplayer
+ 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.
+
+ Is this compatible with other Youtube extensions?
+ 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.
+
+ I'm having a different problem
+ 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. +
+
+ + +
Report an issue
+
+
Your message has been sent successfully.
+
+
+ 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!
+
+ * Please read the FAQs above before reporting an issue. +
+ + + +
+
+ + +
+
+ `);let D=document.createElement("style");D.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(D);let Q=document.querySelector(".goodTube_menuButton"),Ve=document.querySelector(".goodTube_menuClose");Ve&&Ve.addEventListener("click",()=>{Q.remove(),Ve.remove()});let U=document.querySelector(".goodTube_modal"),ne=document.querySelector(".goodTube_modal .goodTube_modal_overlay"),pt=document.querySelector(".goodTube_modal .goodTube_modal_closeButton");Q&&Q.addEventListener("click",()=>{if(U){let z=document.querySelector(".goodTube_report");z&&(z.style.display="block");let X=document.querySelector(".goodTube_successText");X&&(X.style.display="none");let $=document.querySelector(".goodTube_reportEmail");$&&($.value="");let S=document.querySelector(".goodTube_reportText");S&&(S.value=""),U.classList.add("visible")}}),ne&&ne.addEventListener("click",()=>{U&&U.classList.contains("visible")&&U.classList.remove("visible")}),pt&&pt.addEventListener("click",()=>{U&&U.classList.contains("visible")&&U.classList.remove("visible")}),document.addEventListener("keydown",z=>{z.key.toLowerCase()==="escape"&&U&&U.classList.contains("visible")&&U.classList.remove("visible")});let be=document.getElementById("goodTube_button_saveSettings");be&&be.addEventListener("click",()=>{let z=document.querySelector(".goodTube_option_shorts");z&&(z.checked?y("goodTube_shorts","false"):y("goodTube_shorts","true"));let X=document.querySelector(".goodTube_option_hideInfoCards");X&&(X.checked?y("goodTube_hideInfoCards","true"):y("goodTube_hideInfoCards","false"));let $=document.querySelector(".goodTube_option_hideEndScreen");$&&($.checked?y("goodTube_hideEndScreen","true"):y("goodTube_hideEndScreen","false"));let S=document.querySelector(".goodTube_option_hideSuggestedVideos");S&&(S.checked?y("goodTube_hideSuggestedVideos","true"):y("goodTube_hideSuggestedVideos","false"));let M=document.querySelector(".goodTube_option_hideComments");M&&(M.checked?y("goodTube_hideComments","true"):y("goodTube_hideComments","false"));let ae=document.querySelector(".goodTube_option_hideAiSummaries");ae&&(ae.checked?y("goodTube_hideAiSummaries","true"):y("goodTube_hideAiSummaries","false"));let Fe=document.querySelector(".goodTube_option_alwaysStart");Fe&&(Fe.checked?y("goodTube_alwaysStart","true"):y("goodTube_alwaysStart","false"));let C=document.querySelector(".goodTube_option_blackBackground");C&&(C.checked?y("goodTube_blackBackground","true"):y("goodTube_blackBackground","false")),window.location.href=window.location.href});let ye=document.querySelector(".goodTube_report"),Se=document.querySelector(".goodTube_successText");ye&&Se&&ye.addEventListener("submit",z=>{z.preventDefault(),z.stopImmediatePropagation();let X={email:document.querySelector(".goodTube_reportEmail")?.value,message:document.querySelector(".goodTube_reportText")?.value},$={method:"POST",body:JSON.stringify(X),headers:{"Content-Type":"application/json; charset=UTF-8"},referrerPolicy:"no-referrer"};fetch("https://jamenlyndon.com/_other/stats/mail.php",$).then(S=>S.text()).then(S=>{ye.style.display="none",Se.style.display="block"})})}function on(){window.addEventListener("focus",()=>{St=!0}),window.addEventListener("blur",()=>{St=!1})}function nn(){let e=document.createElement("style"),o=` + .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&&(o+=` + .ytp-pip-button { + display: inline-block !important; + } + `),Be==="true"&&(o+=` + .ytp-ce-covering-overlay, + .ytp-ce-element { + display: none !important; + } + `),Pe==="true"&&(o+=` + .ytp-videowall-still { + display: none !important; + } + `),e.textContent=o,document.head.appendChild(e);function i(r){if(!G()||ce!=="enabled"||r.ctrlKey||r.altKey||r.metaKey)return;let f=r.key.toLowerCase(),s=r.srcElement,c=!1,E=!1;s&&(typeof s.nodeName<"u"&&(c=s.nodeName.toLowerCase()),typeof s.getAttribute<"u"&&(E=s.getAttribute("id"))),(!s||c.indexOf("input")===-1&&c.indexOf("label")===-1&&c.indexOf("select")===-1&&c.indexOf("textarea")===-1&&c.indexOf("fieldset")===-1&&c.indexOf("legend")===-1&&c.indexOf("datalist")===-1&&c.indexOf("output")===-1&&c.indexOf("option")===-1&&c.indexOf("optgroup")===-1&&E!=="contenteditable-root")&&(f===" "||f==="k"||f==="m"||f==="i")&&(r.preventDefault(),r.stopImmediatePropagation())}document.addEventListener("keydown",i,!0),document.addEventListener("keypress",i,!0),document.addEventListener("keyup",i,!0),Lo()}function an(){v&&G()?wt()?rn():dn():ce=""}let ce="";function rn(){let e=document.getElementById("goodTube_hideMuteAdsOverlay");if(ce==="enabled"&&e)return;let o=document.querySelector("#movie_player video");o&&(o.playbackRate=2,o.muted=!0,o.volume=0,J(o));let i=document.querySelector(".ytp-chrome-bottom");i&&J(i);let r=document.getElementById("movie_player");r&&(r.style.pointerEvents="none");let f=document.querySelector(".ytp-caption-window-container");if(r&&J(f),!e){let s=document.createElement("div");s.setAttribute("id","goodTube_hideMuteAdsOverlay"),Ke(s,` +
+ +
+
Sorry, we can't remove the ads from this video but we can hide and mute them!
+
Hang tight. Click the skip button if it appears to speed things up.
+
+
+ `);let c=document.querySelector(".ytp-ad-player-overlay-layout");c&&c.prepend(s)}Rt(!0),ce="enabled"}function dn(){if(ce==="disabled")return;let e=document.querySelector("#movie_player video");e&&(e.playbackRate=xe,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)),Ze(e));let o=document.querySelector(".ytp-chrome-bottom");o&&Ze(o);let i=document.getElementById("movie_player");i&&(i.style.pointerEvents="auto");let r=document.querySelector(".ytp-caption-window-container");i&&Ze(r);let f=document.getElementById("goodTube_hideMuteAdsOverlay");f&&f.remove(),Rt(),ce="disabled"}let Io=setTimeout(()=>{},0);function Lo(){let e=document.querySelector("#movie_player .ytp-autonav-toggle-button");e?e.addEventListener("click",()=>{let o="true";e.getAttribute("aria-checked")==="true"&&(o="false"),y("goodTube_autoplay",o),Y.contentWindow.postMessage("goodTube_autoplay_"+o,"*")}):(clearTimeout(Io),Io=setTimeout(Lo,100))}let Do=setTimeout(()=>{},0);function Mo(){let e=document.querySelector("#movie_player .ytp-autonav-toggle-button");e&&e.checkVisibility()?e.getAttribute("aria-checked")!==W&&q(e):(clearTimeout(Do),Do=setTimeout(Mo,100))}let Co=setTimeout(()=>{},0);function Rt(e=!1){if(!(!v||!G())&&(d=document.getElementById("movie_player"),d&&typeof d.playVideo=="function"&&typeof d.mute=="function"&&typeof d.setVolume=="function")){let o=document.querySelector("#movie_player video");if(d.playVideo(),e&&(d.mute(),d.setVolume(0)),o){e&&(o.muted=!0,o.volume=0);let i=o.currentTime;clearTimeout(Co),Co=setTimeout(()=>{o.currentTime===i&&Rt()},100)}}}let Ro=!1,No=setTimeout(()=>{},0);function Oo(e=!1){e||(window.addEventListener("message",ut),document.addEventListener("DOMContentLoaded",lt),(document.readyState==="interactive"||document.readyState==="complete")&<()),!document.body||!document.head?(clearTimeout(No),No=setTimeout(()=>{Oo(!0)},1)):lt()}let Bo=setTimeout(()=>{},0);function lt(){u=document.getElementById("movie_player");let e=!1;if(u&&typeof u.getVideoData=="function"&&(e=u.getVideoData()),!e){clearTimeout(Bo),Bo=setTimeout(lt,1);return}Ro||(Ro=!0,cn(),Fo(),Yo(),pn(),Ae(),yn(),setInterval($o,5e3),sn(),Po(),setInterval(Po,100),window.top.postMessage("goodTube_playerIframe_loaded","*"))}function Po(){ln(),bn(),un(),_n(),A.goodTube_playlist!=="undefined"&&A.goodTube_playlist==="true"&&zo(),hn()}function ln(){document.querySelector(".ytp-error")?v||(v=!0,window.top.postMessage("goodTube_fallback_enable","*"),Ae(),clearTimeout(ct)):v&&(v=!1,window.top.postMessage("goodTube_fallback_disable","*"),Ae(),clearTimeout(ct))}function sn(){typeof A.goodTube_playbackSpeed<"u"&&u&&typeof u.setPlaybackRate=="function"&&u.setPlaybackRate(parseFloat(A.goodTube_playbackSpeed)),setInterval(()=>{u&&typeof u.getPlaybackRate=="function"&&window.top.postMessage("goodTube_playbackSpeed_"+u.getPlaybackRate(),"*")},100)}function un(){document.querySelectorAll(".ytp-videowall-still:not(.goodTube_fixed), .ytp-ce-covering-overlay:not(.goodTube_fixed)").forEach(o=>{o.addEventListener("click",i=>{i.preventDefault(),i.stopImmediatePropagation(),window.top.location.href=o.href},!0),o.addEventListener("mousedown",i=>{i.button===0&&(i.preventDefault(),i.stopImmediatePropagation())},!0),o.addEventListener("mouseup",i=>{i.button===0&&(i.preventDefault(),i.stopImmediatePropagation())},!0),o.addEventListener("touchstart",i=>{i.preventDefault(),i.stopImmediatePropagation()},!0),o.addEventListener("touchend",i=>{i.preventDefault(),i.stopImmediatePropagation()},!0),o.classList.add("goodTube_fixed")})}function cn(){let e=document.createElement("style"),o=` + /* 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&&(o+=` + .ytp-pip-button { + display: inline-block !important; + } + `),A.goodTube_hideInfoCards==="true"&&(o+=` + .ytp-ce-covering-overlay, + .ytp-ce-element { + display: none !important; + } + `),A.goodTube_hideEndScreen==="true"&&(o+=` + .ytp-videowall-still { + display: none !important; + } + `),e.textContent=o,document.head.appendChild(e)}function zo(){let e=document.querySelector(".ytp-prev-button");e&&!e.classList.contains("goodTube_visible")&&e.classList.add("goodTube_visible")}function fn(){let e=document.querySelector(".ytp-prev-button");e&&e.classList.contains("goodTube_visible")&&e.classList.remove("goodTube_visible")}let Vo=setTimeout(()=>{},0);function Fo(){if(!document.querySelector(".ytp-play-button")){clearTimeout(Vo),Vo=setTimeout(Fo,100);return}let o=document.querySelector(".ytp-prev-button");o&&o.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 r=document.querySelector(".ytp-size-button");r&&(r.setAttribute("data-tooltip-target-id","ytp-size-button"),r.setAttribute("data-title-no-tooltip","Theater mode (t)"),r.setAttribute("aria-label","Theater mode (t)"),r.setAttribute("title","Theater mode (t)"),r.setAttribute("data-tooltip-title","Theater mode (t)"),Ke(r,` + + `),r.addEventListener("click",function(){window.top.postMessage("goodTube_theater","*")}));let f=document.querySelector(".ytp-subtitles-button");if(f){Vi(f,"beforebegin",'');let s=document.querySelector("#goodTube_autoplayButton");s&&s.addEventListener("click",function(){let c=s.querySelector(".ytp-autonav-toggle-button");c.getAttribute("aria-checked")==="true"?(c.setAttribute("aria-checked","false"),window.top.postMessage("goodTube_autoplay_false","*")):(c.setAttribute("aria-checked","true"),window.top.postMessage("goodTube_autoplay_true","*"))})}}let Uo=setTimeout(()=>{},0);function Yo(){let e=document.querySelector("#movie_player video");if(!e){clearTimeout(Uo),Uo=setTimeout(Yo,100);return}e.addEventListener("ended",function(){$o(!0),window.top.postMessage("goodTube_videoEnded","*")})}function pn(){document.addEventListener("keydown",function(e){if(e.ctrlKey||e.altKey||e.metaKey||v)return;let o=e.key.toLowerCase();if(o==="t"&&window.top.postMessage("goodTube_theater","*"),o==="i"){let i=document.querySelector(".ytp-pip-button");i&&q(i)}else o==="p"&&e.shiftKey?window.top.postMessage("goodTube_prevVideo","*"):o==="n"&&e.shiftKey&&window.top.postMessage("goodTube_nextVideo","*")})}let ie=setTimeout(()=>{},0),Z=!1,fe=-1,pe=!1,me=!1,ge=!1,x=document.querySelector("video"),O=document.querySelector(".goodTube_doubleSpeed");function Nt(e){let o=e.key.toLowerCase();if(o===" "||o==="k"){if(v)return;if(me){e.preventDefault(),e.stopImmediatePropagation();return}if(e.ctrlKey||e.altKey||e.metaKey||(e.preventDefault(),e.stopImmediatePropagation(),Z)||pe)return;pe=!0,fe=u.getPlaybackRate(),clearTimeout(ie),ie=setTimeout(()=>{u.setPlaybackRate(2),u.playVideo(),O.style.display="block",Z=!0},1e3)}}function Ot(e){let o=e.key.toLowerCase();if(o===" "||o==="k"){if(v)return;if(me){e.preventDefault(),e.stopImmediatePropagation();return}if(e.ctrlKey||e.altKey||e.metaKey)return;e.preventDefault(),e.stopImmediatePropagation()}}function Bt(e){let o=e.key.toLowerCase();if(o===" "||o==="k"){if(v)return;if(me){e.preventDefault(),e.stopImmediatePropagation();return}if(e.ctrlKey||e.altKey||e.metaKey)return;clearTimeout(ie),Z?(u.setPlaybackRate(fe),O.style.display="none",Z=!1):(x=document.querySelector("video"),ge=!0,q(x),ge=!1),pe=!1,e.preventDefault(),e.stopImmediatePropagation()}}function ve(e){if(e.button===0&&!ge&&!v){if(pe){e.preventDefault(),e.stopImmediatePropagation();return}me=!0,e.preventDefault(),e.stopImmediatePropagation(),fe=u.getPlaybackRate(),clearTimeout(ie),ie=setTimeout(()=>{u.setPlaybackRate(2),u.playVideo(),O.style.display="block",Z=!0},1e3)}}function Pt(e){ge||v||(e.preventDefault(),e.stopImmediatePropagation())}function ke(e){if(e.button===0&&!ge&&!v){if(pe){e.preventDefault(),e.stopImmediatePropagation();return}clearTimeout(ie),Z?(u.setPlaybackRate(fe),O.style.display="none",Z=!1):(x=document.querySelector("video"),ge=!0,q(x),ge=!1,setTimeout(x.focus())),me=!1,e.preventDefault(),e.stopImmediatePropagation()}}function we(e){if(!v){if(pe){e.preventDefault(),e.stopImmediatePropagation();return}e.preventDefault(),e.stopImmediatePropagation(),clearTimeout(ie),Z&&(u.setPlaybackRate(fe),O.style.display="none",Z=!1),me=!1}}let st=setTimeout(()=>{},0);function Ae(){if(clearTimeout(ie),Z=!1,pe=!1,me=!1,x=document.querySelector("video"),O=document.querySelector(".goodTube_doubleSpeed"),v){document.removeEventListener("keydown",Nt,!0),document.removeEventListener("keypress",Ot,!0),document.removeEventListener("keyup",Bt,!0),x&&(x.removeEventListener("mousedown",ve,!0),x.removeEventListener("touchstart",ve,!0),x.removeEventListener("click",Pt,!0),x.removeEventListener("mouseup",ke,!0),x.removeEventListener("touchend",ke,!0),x.removeEventListener("mouseout",we,!0),x.removeEventListener("touchcancel",we,!0)),O&&(O.style.display="none");return}if(!x){clearTimeout(st),st=setTimeout(Ae,100);return}if(u=document.getElementById("movie_player"),!u||typeof u.getPlaybackRate!="function"||typeof u.setPlaybackRate!="function"||typeof u.playVideo!="function"){clearTimeout(st),st=setTimeout(Ae,100);return}if(fe=u.getPlaybackRate(),u.setPlaybackRate(fe),O)O.style.display="none";else{O=document.createElement("div"),O.classList.add("goodTube_doubleSpeed"),O.style.position="relative",O.style.zIndex="999",O.style.display="none",Ke(O,` +
+
+
2x
+
+ + + +
+
+
+ `);let e=document.querySelector(".html5-video-player");e&&e.appendChild(O)}document.removeEventListener("keydown",Nt,!0),document.addEventListener("keydown",Nt,!0),document.removeEventListener("keypress",Ot,!0),document.addEventListener("keypress",Ot,!0),document.removeEventListener("keyup",Bt,!0),document.addEventListener("keyup",Bt,!0),x.removeEventListener("mousedown",ve,!0),x.addEventListener("mousedown",ve,!0),x.removeEventListener("touchstart",ve,!0),x.addEventListener("touchstart",ve,!0),x.removeEventListener("click",Pt,!0),x.addEventListener("click",Pt,!0),x.removeEventListener("mouseup",ke,!0),x.addEventListener("mouseup",ke,!0),x.removeEventListener("touchend",ke,!0),x.addEventListener("touchend",ke,!0),x.removeEventListener("mouseout",we,!0),x.addEventListener("mouseout",we,!0),x.removeEventListener("touchcancel",we,!0),x.addEventListener("touchcancel",we,!0)}function mn(e,o){u=document.getElementById("movie_player"),u&&typeof u.loadVideoById=="function"&&typeof u.getVideoData=="function"&&(u.loadVideoById({videoId:e,startSeconds:o}),Ae())}let Ee=setTimeout(()=>{},0);function ut(e){if(typeof e.data!="string")return;if(!document.body||!document.head){clearTimeout(Ee),Ee=setTimeout(()=>{ut(e)},100);return}u=document.getElementById("movie_player");let o=!1;if(u&&typeof u.getVideoData=="function"&&(o=u.getVideoData()),!o){clearTimeout(Ee),Ee=setTimeout(()=>{ut(e)},100);return}if(e.data.indexOf("goodTube_load_")!==-1){let i=e.data.replace("goodTube_load_","").split("|||"),r=i[0],f=parseFloat(i[1]);i[2]==="true"?zo():fn(),mn(r,f)}else if(e.data==="goodTube_stopVideo")Vt(),Zo();else if(e.data.indexOf("goodTube_skipTo_")!==-1){let i=e.data.replace("goodTube_skipTo_","").split("|||"),r=parseFloat(i[0]),f=i[1];if(f!==""&&o.video_id!==f){clearTimeout(Ee),Ee=setTimeout(()=>{ut(e)},100);return}jo(r)}else if(e.data==="goodTube_pause")Vt();else if(e.data.indexOf("goodTube_play|||")!==-1)Xo(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 r=e.data.replace("goodTube_shortcut_","").split("_"),f=r[0],s={bubbles:!0,key:r[1],keyCode:r[2],ctrlKey:r[3]==="true",metaKey:r[4]==="true",shiftKey:r[5]==="true",altKey:r[6]==="true"};i.dispatchEvent(new KeyboardEvent(f,s))}}else e.data==="goodTube_fullscreen"?Ho():e.data==="goodTube_autoplay_true"?(y("goodTube_autoplay","true"),W="true",zt("true")):e.data==="goodTube_autoplay_false"&&(y("goodTube_autoplay","false"),W="false",zt("false"))}let ct=setTimeout(()=>{},0);function Ho(){let e=document.querySelector(".ytp-fullscreen-button");e?q(e):(clearTimeout(ct),ct=setTimeout(Ho,100))}let Go=setTimeout(()=>{},0);function zt(e){let o=document.querySelector("#goodTube_autoplayButton");o?o.querySelector(".ytp-autonav-toggle-button").getAttribute("aria-checked")!==e&&q(o):(clearTimeout(Go),Go=setTimeout(()=>{zt(e)},100))}let Qo=setTimeout(()=>{},0);function jo(e){let o=document.querySelector("video");o?o.currentTime=parseFloat(e):(clearTimeout(Qo),Qo=setTimeout(()=>{jo(e)},100))}let qo=setTimeout(()=>{},0);function Vt(){let e=document.querySelector("video");e?e.pause():(clearTimeout(qo),qo=setTimeout(Vt,100))}let Wo=setTimeout(()=>{},0);function Zo(){let e=document.querySelector("video");e?e.muted=!0:(clearTimeout(Wo),Wo=setTimeout(Zo,100))}let Ko=setTimeout(()=>{},0);function gn(){let e=document.querySelector("video");e?e.muted=!1:(clearTimeout(Ko),Ko=setTimeout(gn,100))}let Jo=setTimeout(()=>{},0);function Xo(e){u=document.getElementById("movie_player");let o=!1;if(u&&typeof u.getVideoData=="function"&&(o=u.getVideoData()),!o||e!==o.video_id){clearTimeout(Jo),Jo=setTimeout(()=>{Xo(e)},100);return}let i=document.querySelector("#movie_player video");i&&i.currentTime>=i.duration||u&&typeof u.playVideo=="function"&&u.playVideo()}function bn(){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 $o(e=!1){let o=document.querySelector("video");if(o){let i=o.currentTime;e&&(i=o.duration),window.top.postMessage("goodTube_syncMainPlayer_"+i,"*")}}function yn(){addEventListener("leavepictureinpicture",e=>{Oe=!1,window.top.postMessage("goodTube_pip_false","*")}),addEventListener("enterpictureinpicture",e=>{Oe=!0,window.top.postMessage("goodTube_pip_true","*")})}function _n(){"mediaSession"in navigator&&(navigator.mediaSession.setActionHandler("nexttrack",()=>{window.top.postMessage("goodTube_nextVideo","*")}),navigator.mediaSession.setActionHandler("previoustrack",()=>{window.top.postMessage("goodTube_prevVideo","*")}))}function hn(){let e=document.querySelector("video");if(e){let r=function(c,E){return E==0?c:r(E,c%E)},f=function(c,E){var k=r(c,E);return[c/k,E/k]},o=e.videoWidth,i=e.videoHeight,s=f(o,i);s.length===2&&!isNaN(s[0])&&!isNaN(s[1])&&window.top.postMessage("goodTube_syncAspectRatio_"+s[0]+"_"+s[1],"*")}}let ei=!1,ti=setTimeout(()=>{},0);function oi(){window.addEventListener("message",Ut),document.addEventListener("DOMContentLoaded",Ft),(document.readyState==="interactive"||document.readyState==="complete")&&Ft(),!document.body||!document.head?(clearTimeout(ti),ti=setTimeout(oi,1)):Ft()}function Ft(){ei||(ei=!0,Tn(),xn(),window.top.postMessage("goodTube_proxyIframe_loaded","*"))}function Tn(){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 xn(){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 ft=setTimeout(()=>{},0);function Ut(e){if(typeof e.data!="string")return;(!document.body||!document.head)&&(clearTimeout(ft),ft=setTimeout(()=>{Ut(e)},100));let o=document.getElementById("goodTube_youtube_iframe");o?e.data.indexOf("goodTube_src_")!==-1?o.src===""||o.src.indexOf("?goodTubeProxy=1")!==-1?o.src=e.data.replace("goodTube_src_",""):o.contentWindow.location.replace(e.data.replace("goodTube_src_","")):o.contentWindow.postMessage(e.data,"*"):(clearTimeout(ft),ft=setTimeout(()=>{Ut(e)},100))}function vn(){window.top===window.self&&window.location.href.indexOf("youtube")!==-1?Ao():window.location.href.indexOf("?goodTubeProxy=1")!==-1?oi():window.location.href.indexOf("?goodTubeEmbed=1")!==-1&&Oo()}vn()})()});sa();})(); diff --git a/goodtube.user.js b/goodtube.user.js index aa47f4e..8ef0c44 100644 --- a/goodtube.user.js +++ b/goodtube.user.js @@ -20,14 +20,14 @@ // @name GoodTube // @description A free Youtube adblocker. Removes 100% of Youtube ads and also provides an option to disable shorts. -// @version 3.002 +// @version 3.003 // @author GoodTube // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDkuMS1jMDAzIDc5Ljk2OTBhODdmYywgMjAyNS8wMy8wNi0yMDo1MDoxNiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDI2LjkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkIyM0MxODVGQkQyQTExRjA4N0I2QTU0RDU1NEYxRDBGIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkIyM0MxODYwQkQyQTExRjA4N0I2QTU0RDU1NEYxRDBGIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QjIzQzE4NURCRDJBMTFGMDg3QjZBNTRENTU0RjFEMEYiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QjIzQzE4NUVCRDJBMTFGMDg3QjZBNTRENTU0RjFEMEYiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4gnVxyAAAEKUlEQVR42uxZ3U4TQRQ+p7TGG4kJL4AxvUBJDLMtxnjrkxBoqQ8EtIWH0AfwSi+k3SEmKjFBQiCRWzQRMf05zu50dufM/qQIGtqwibG7MzvznXO+852zAxIRTNJVgAm7bgHfAnauYtZAd60+ykYcPSGotJt44wD7tUYItPKyAT9PT+HLq9fhc9Hc+mdgzZ7GMcPBIPxV3WnjdFFC1huExqbhEI7fvoP/odNeaxPN/sF2VRXd8F55nqzxCLAv1kJUD2sv4P6zBT3S76noEODIgu7auqZKO6aGec/MEX7rSrTRvomXGCgMhWJpvKS7zkt6NRamqxhWtD1Eh0fq5gcYdViYnwcI/gWbSqkSbxOzvUNXTrpyuQwnJ8cAFxc66VZWQof7QhvsyRYW41C4m1JgSe5GiHiJcBNwmbTX0f/Pzt6Dx4uLAB8/2aMaC/dw+ib7n/fh/PycJQbPlhkd4tZmLnJDAb+2nhoGEzk9juB5gjnOdsxkylrkAZX1R28OtV2VJWVrOQpHkDhuslCGWmhVpKSXKjNqzWQwDEex+khR5xt8P9Pv0tlZvg4Hixqu4RhJhRZwl8+FAkL8ClrQKZPDAHfVzQM4+KorHfoH4b6ejCseZmV3KEVPq0D9vtVgSAbMvOrVq0kEBIkEls3dFOMDzy/xRFb7ZMnfxHEY8/TTcEvzS3mhuweitpxUpyCr7XUQOcvtLeSenjuaE3idvCUWwbzCwgE328TDGt/6zY5S8iWFrZgMexBScoFiOmB/jz3w/T6goUB9mRts9q+v4fQ18No6XmXQtT7yKDqyMnqPEjKQrKDojvPIpgNubZO7sfR7jgARDxMju3Seo8MDF1D8CC3V8GWfzRZeSc81+GqrqpcIeaundDqqnSuYHrWBrswROR4mxxhTUh3+h7xF4JEZjdtmeU2+p1/bJNWWQ7VainJsMjnsq/CH7dw2txCa28Q4rEY7u73IUcvLvLmG3U78e26O08ly5e9fQ4dpaKmU+l1fRTvKgafDe6+oFKW2EVZLlwKRxBm9DIxSOgwVEVUrpj4IXPLs0HZ7GaVYvduR0ZpepcSpZMlZCBrzVMLwzHAtYjolmp+kgvAZYY+S6CEwHkOn1uf02YW0BLuJl8GYXemUB6TsWU12A4NPGfQHiQ4OqyJV7aJPL3vwfRdsXcPnd0BsmK9mzVUhSjyGFjUyKREkIvO8MgbxieKbLUPraCQPU1pQMqBoGO0tPuygXN+Kpw4KkaNEM5lk03a2hmnfiMxnad+SFJ1fYKoakPILFnjZj788AombyUn8XMAEQOORnz2T7UslrbAqmpYrzDtZGb8fdouIbyVh4CEx4vClzyFGyWV8FHHVSq7pPx9O5e/Q7ij//qTH/nKmS64zPmAVrgq0r+UoU4QlPL0ETx0l8PbvdLeAJxzwHwEGAEe89+zqt8ZVAAAAAElFTkSuQmCC // @namespace https://github.com/goodtube4u/goodtube/ // @updateURL https://github.com/goodtube4u/goodtube/raw/refs/heads/main/goodtube.user.js // @downloadURL https://github.com/goodtube4u/goodtube/raw/refs/heads/main/goodtube.user.js -// @require https://raw.githubusercontent.com/goodtube4u/goodtube/refs/heads/main/goodtube.js +// @require https://raw.githubusercontent.com/goodtube4u/goodtube/refs/heads/main/goodtube.min.js // @match *://m.youtube.com/* // @match *://www.youtube.com/* diff --git a/package.json b/package.json new file mode 100644 index 0000000..2588f19 --- /dev/null +++ b/package.json @@ -0,0 +1,8 @@ +{ + "scripts": { + "watch": "esbuild ./goodtube.js --bundle --outfile=./goodtube.min.js --watch --minify" + }, + "devDependencies": { + "esbuild": "^0.26.0" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..53aa982 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,285 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + esbuild: + specifier: ^0.26.0 + version: 0.26.0 + +packages: + + '@esbuild/aix-ppc64@0.26.0': + resolution: {integrity: sha512-hj0sKNCQOOo2fgyII3clmJXP28VhgDfU5iy3GNHlWO76KG6N7x4D9ezH5lJtQTG+1J6MFDAJXC1qsI+W+LvZoA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.26.0': + resolution: {integrity: sha512-DDnoJ5eoa13L8zPh87PUlRd/IyFaIKOlRbxiwcSbeumcJ7UZKdtuMCHa1Q27LWQggug6W4m28i4/O2qiQQ5NZQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.26.0': + resolution: {integrity: sha512-C0hkDsYNHZkBtPxxDx177JN90/1MiCpvBNjz1f5yWJo1+5+c5zr8apjastpEG+wtPjo9FFtGG7owSsAxyKiHxA==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.26.0': + resolution: {integrity: sha512-bKDkGXGZnj0T70cRpgmv549x38Vr2O3UWLbjT2qmIkdIWcmlg8yebcFWoT9Dku7b5OV3UqPEuNKRzlNhjwUJ9A==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.26.0': + resolution: {integrity: sha512-6Z3naJgOuAIB0RLlJkYc81An3rTlQ/IeRdrU3dOea8h/PvZSgitZV+thNuIccw0MuK1GmIAnAmd5TrMZad8FTQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.26.0': + resolution: {integrity: sha512-OPnYj0zpYW0tHusMefyaMvNYQX5pNQuSsHFTHUBNp3vVXupwqpxofcjVsUx11CQhGVkGeXjC3WLjh91hgBG2xw==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.26.0': + resolution: {integrity: sha512-jix2fa6GQeZhO1sCKNaNMjfj5hbOvoL2F5t+w6gEPxALumkpOV/wq7oUBMHBn2hY2dOm+mEV/K+xfZy3mrsxNQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.26.0': + resolution: {integrity: sha512-tccJaH5xHJD/239LjbVvJwf6T4kSzbk6wPFerF0uwWlkw/u7HL+wnAzAH5GB2irGhYemDgiNTp8wJzhAHQ64oA==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.26.0': + resolution: {integrity: sha512-IMJYN7FSkLttYyTbsbme0Ra14cBO5z47kpamo16IwggzzATFY2lcZAwkbcNkWiAduKrTgFJP7fW5cBI7FzcuNQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.26.0': + resolution: {integrity: sha512-JY8NyU31SyRmRpuc5W8PQarAx4TvuYbyxbPIpHAZdr/0g4iBr8KwQBS4kiiamGl2f42BBecHusYCsyxi7Kn8UQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.26.0': + resolution: {integrity: sha512-XITaGqGVLgk8WOHw8We9Z1L0lbLFip8LyQzKYFKO4zFo1PFaaSKsbNjvkb7O8kEXytmSGRkYpE8LLVpPJpsSlw==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.26.0': + resolution: {integrity: sha512-MkggfbDIczStUJwq9wU7gQ7kO33d8j9lWuOCDifN9t47+PeI+9m2QVh51EI/zZQ1spZtFMC1nzBJ+qNGCjJnsg==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.26.0': + resolution: {integrity: sha512-fUYup12HZWAeccNLhQ5HwNBPr4zXCPgUWzEq2Rfw7UwqwfQrFZ0SR/JljaURR8xIh9t+o1lNUFTECUTmaP7yKA==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.26.0': + resolution: {integrity: sha512-MzRKhM0Ip+//VYwC8tialCiwUQ4G65WfALtJEFyU0GKJzfTYoPBw5XNWf0SLbCUYQbxTKamlVwPmcw4DgZzFxg==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.26.0': + resolution: {integrity: sha512-QhCc32CwI1I4Jrg1enCv292sm3YJprW8WHHlyxJhae/dVs+KRWkbvz2Nynl5HmZDW/m9ZxrXayHzjzVNvQMGQA==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.26.0': + resolution: {integrity: sha512-1D6vi6lfI18aNT1aTf2HV+RIlm6fxtlAp8eOJ4mmnbYmZ4boz8zYDar86sIYNh0wmiLJEbW/EocaKAX6Yso2fw==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.26.0': + resolution: {integrity: sha512-rnDcepj7LjrKFvZkx+WrBv6wECeYACcFjdNPvVPojCPJD8nHpb3pv3AuR9CXgdnjH1O23btICj0rsp0L9wAnHA==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.26.0': + resolution: {integrity: sha512-FSWmgGp0mDNjEXXFcsf12BmVrb+sZBBBlyh3LwB/B9ac3Kkc8x5D2WimYW9N7SUkolui8JzVnVlWh7ZmjCpnxw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.26.0': + resolution: {integrity: sha512-0QfciUDFryD39QoSPUDshj4uNEjQhp73+3pbSAaxjV2qGOEDsM67P7KbJq7LzHoVl46oqhIhJ1S+skKGR7lMXA==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.26.0': + resolution: {integrity: sha512-vmAK+nHhIZWImwJ3RNw9hX3fU4UGN/OqbSE0imqljNbUQC3GvVJ1jpwYoTfD6mmXmQaxdJY6Hn4jQbLGJKg5Yw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.26.0': + resolution: {integrity: sha512-GPXF7RMkJ7o9bTyUsnyNtrFMqgM3X+uM/LWw4CeHIjqc32fm0Ir6jKDnWHpj8xHFstgWDUYseSABK9KCkHGnpg==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/openharmony-arm64@0.26.0': + resolution: {integrity: sha512-nUHZ5jEYqbBthbiBksbmHTlbb5eElyVfs/s1iHQ8rLBq1eWsd5maOnDpCocw1OM8kFK747d1Xms8dXJHtduxSw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + + '@esbuild/sunos-x64@0.26.0': + resolution: {integrity: sha512-TMg3KCTCYYaVO+R6P5mSORhcNDDlemUVnUbb8QkboUtOhb5JWKAzd5uMIMECJQOxHZ/R+N8HHtDF5ylzLfMiLw==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.26.0': + resolution: {integrity: sha512-apqYgoAUd6ZCb9Phcs8zN32q6l0ZQzQBdVXOofa6WvHDlSOhwCWgSfVQabGViThS40Y1NA4SCvQickgZMFZRlA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.26.0': + resolution: {integrity: sha512-FGJAcImbJNZzLWu7U6WB0iKHl4RuY4TsXEwxJPl9UZLS47agIZuILZEX3Pagfw7I4J3ddflomt9f0apfaJSbaw==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.26.0': + resolution: {integrity: sha512-WAckBKaVnmFqbEhbymrPK7M086DQMpL1XoRbpmN0iW8k5JSXjDRQBhcZNa0VweItknLq9eAeCL34jK7/CDcw7A==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + + esbuild@0.26.0: + resolution: {integrity: sha512-3Hq7jri+tRrVWha+ZeIVhl4qJRha/XjRNSopvTsOaCvfPHrflTYTcUFcEjMKdxofsXXsdc4zjg5NOTnL4Gl57Q==} + engines: {node: '>=18'} + hasBin: true + +snapshots: + + '@esbuild/aix-ppc64@0.26.0': + optional: true + + '@esbuild/android-arm64@0.26.0': + optional: true + + '@esbuild/android-arm@0.26.0': + optional: true + + '@esbuild/android-x64@0.26.0': + optional: true + + '@esbuild/darwin-arm64@0.26.0': + optional: true + + '@esbuild/darwin-x64@0.26.0': + optional: true + + '@esbuild/freebsd-arm64@0.26.0': + optional: true + + '@esbuild/freebsd-x64@0.26.0': + optional: true + + '@esbuild/linux-arm64@0.26.0': + optional: true + + '@esbuild/linux-arm@0.26.0': + optional: true + + '@esbuild/linux-ia32@0.26.0': + optional: true + + '@esbuild/linux-loong64@0.26.0': + optional: true + + '@esbuild/linux-mips64el@0.26.0': + optional: true + + '@esbuild/linux-ppc64@0.26.0': + optional: true + + '@esbuild/linux-riscv64@0.26.0': + optional: true + + '@esbuild/linux-s390x@0.26.0': + optional: true + + '@esbuild/linux-x64@0.26.0': + optional: true + + '@esbuild/netbsd-arm64@0.26.0': + optional: true + + '@esbuild/netbsd-x64@0.26.0': + optional: true + + '@esbuild/openbsd-arm64@0.26.0': + optional: true + + '@esbuild/openbsd-x64@0.26.0': + optional: true + + '@esbuild/openharmony-arm64@0.26.0': + optional: true + + '@esbuild/sunos-x64@0.26.0': + optional: true + + '@esbuild/win32-arm64@0.26.0': + optional: true + + '@esbuild/win32-ia32@0.26.0': + optional: true + + '@esbuild/win32-x64@0.26.0': + optional: true + + esbuild@0.26.0: + optionalDependencies: + '@esbuild/aix-ppc64': 0.26.0 + '@esbuild/android-arm': 0.26.0 + '@esbuild/android-arm64': 0.26.0 + '@esbuild/android-x64': 0.26.0 + '@esbuild/darwin-arm64': 0.26.0 + '@esbuild/darwin-x64': 0.26.0 + '@esbuild/freebsd-arm64': 0.26.0 + '@esbuild/freebsd-x64': 0.26.0 + '@esbuild/linux-arm': 0.26.0 + '@esbuild/linux-arm64': 0.26.0 + '@esbuild/linux-ia32': 0.26.0 + '@esbuild/linux-loong64': 0.26.0 + '@esbuild/linux-mips64el': 0.26.0 + '@esbuild/linux-ppc64': 0.26.0 + '@esbuild/linux-riscv64': 0.26.0 + '@esbuild/linux-s390x': 0.26.0 + '@esbuild/linux-x64': 0.26.0 + '@esbuild/netbsd-arm64': 0.26.0 + '@esbuild/netbsd-x64': 0.26.0 + '@esbuild/openbsd-arm64': 0.26.0 + '@esbuild/openbsd-x64': 0.26.0 + '@esbuild/openharmony-arm64': 0.26.0 + '@esbuild/sunos-x64': 0.26.0 + '@esbuild/win32-arm64': 0.26.0 + '@esbuild/win32-ia32': 0.26.0 + '@esbuild/win32-x64': 0.26.0