|
(()=>{var t={2705:(t,e,r)=>{var n=r(5639).Symbol;t.exports=n},4239:(t,e,r)=>{var n=r(2705),o=r(9607),a=r(2333),s=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?o(t):a(t)}},9877:t=>{var e=Math.floor,r=Math.random;t.exports=function(t,n){return t+e(r()*(n-t+1))}},2545:t=>{t.exports=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}},7561:(t,e,r)=>{var n=r(7990),o=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(o,""):t}},4290:(t,e,r)=>{var n=r(6557);t.exports=function(t){return"function"==typeof t?t:n}},1957:(t,e,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=n},9607:(t,e,r)=>{var n=r(2705),o=Object.prototype,a=o.hasOwnProperty,s=o.toString,i=n?n.toStringTag:void 0;t.exports=function(t){var e=a.call(t,i),r=t[i];try{t[i]=void 0;var n=!0}catch(t){}var o=s.call(t);return n&&(e?t[i]=r:delete t[i]),o}},5776:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,r){var n=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t<r}},6612:(t,e,r)=>{var n=r(7813),o=r(8612),a=r(5776),s=r(3218);t.exports=function(t,e,r){if(!s(r))return!1;var i=typeof e;return!!("number"==i?o(r)&&a(e,r.length):"string"==i&&e in r)&&n(r[e],t)}},2333:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},5639:(t,e,r)=>{var n=r(1957),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();t.exports=a},7990:t=>{var e=/\s/;t.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},7813:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},6557:t=>{t.exports=function(t){return t}},8612:(t,e,r)=>{var n=r(3560),o=r(1780);t.exports=function(t){return null!=t&&o(t.length)&&!n(t)}},3560:(t,e,r)=>{var n=r(4239),o=r(3218);t.exports=function(t){if(!o(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},1780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},3218:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},3448:(t,e,r)=>{var n=r(4239),o=r(7005);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==n(t)}},3608:(t,e,r)=>{var n=r(9877),o=r(6612),a=r(8601),s=parseFloat,i=Math.min,c=Math.random;t.exports=function(t,e,r){if(r&&"boolean"!=typeof r&&o(t,e,r)&&(e=r=void 0),void 0===r&&("boolean"==typeof e?(r=e,e=void 0):"boolean"==typeof t&&(r=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=a(t),void 0===e?(e=t,t=0):e=a(e)),t>e){var u=t;t=e,e=u}if(r||t%1||e%1){var l=c();return i(t+l*(e-t+s("1e-"+((l+"").length-1))),e)}return n(t,e)}},8913:(t,e,r)=>{var n=r(2545),o=r(4290),a=r(554),s=4294967295,i=Math.min;t.exports=function(t,e){if((t=a(t))<1||t>9007199254740991)return[];var r=s,c=i(t,s);e=o(e),t-=s;for(var u=n(c,e);++r<t;)e(r);return u}},8601:(t,e,r)=>{var n=r(4841);t.exports=function(t){return t?Infinity===(t=n(t))||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},554:(t,e,r)=>{var n=r(8601);t.exports=function(t){var e=n(t),r=e%1;return e==e?r?e-r:e:0}},4841:(t,e,r)=>{var n=r(7561),o=r(3218),a=r(3448),s=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(a(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var r=i.test(t);return r||c.test(t)?u(t.slice(2),r?2:8):s.test(t)?NaN:+t}},7061:(t,e,r)=>{var n=r(8698).default;function o(){"use strict";t.exports=o=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var e,r={},a=Object.prototype,s=a.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function p(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(e){p=function(t,e,r){return t[e]=r}}function g(t,e,r,n){var o=e&&e.prototype instanceof S?e:S,a=Object.create(o.prototype),s=new H(n||[]);return i(a,"_invoke",{value:F(t,r,s)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=g;var m="suspendedStart",d="suspendedYield",b="executing",v="completed",y={};function S(){}function w(){}function x(){}var k={};p(k,u,(function(){return this}));var _=Object.getPrototypeOf,j=_&&_(_(I([])));j&&j!==a&&s.call(j,u)&&(k=j);var L=x.prototype=S.prototype=Object.create(k);function O(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(o,a,i,c){var u=h(t[o],t,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&s.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(a,a):a()}})}function F(t,r,n){var o=m;return function(a,s){if(o===b)throw new Error("Generator is already running");if(o===v){if("throw"===a)throw s;return{value:e,done:!0}}for(n.method=a,n.arg=s;;){var i=n.delegate;if(i){var c=P(i,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=b;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?v:d,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var s=a.arg;return s?s.done?(r[t.resultName]=s.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function H(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function I(t){if(t||""===t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(s.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=x,i(L,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=p(x,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,p(t,f,"GeneratorFunction")),t.prototype=Object.create(L),t},r.awrap=function(t){return{__await:t}},O(T.prototype),p(T.prototype,l,(function(){return this})),r.AsyncIterator=T,r.async=function(t,e,n,o,a){void 0===a&&(a=Promise);var s=new T(g(t,e,n,o),a);return r.isGeneratorFunction(e)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},O(L),p(L,f,"Generator"),p(L,u,(function(){return this})),p(L,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=I,H.prototype={constructor:H,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(N),!t)for(var r in this)"t"===r.charAt(0)&&s.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return i.type="throw",i.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=s.call(a,"catchLoc"),u=s.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},r}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},8698:t=>{function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},4687:(t,e,r)=>{var n=r(7061)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(e,r,n){return(r=function(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(r)?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function n(t,e,r,n,o,a,s){try{var i=t[a](s),c=i.value}catch(t){return void r(t)}i.done?e(c):Promise.resolve(c).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,a){var s=t.apply(e,r);function i(t){n(s,o,a,i,c,"next",t)}function c(t){n(s,o,a,i,c,"throw",t)}i(void 0)}))}}var a=r(4687),s=r.n(a),i=r(3608),c=r.n(i),u=r(8913),l=r.n(u);const f=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=new URL(t);return e.filter((function(t){var e=t.value;return e||"boolean"==typeof e})).forEach((function(t){var e=t.name,n=t.value;r.searchParams.append(e,String(n))})),r.href.replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/%2C/g,",")};var p;var g="SELECTORS_TIMESTAMP",h="SELECTORS_LR_TIMESTAMP";const m=function(){return String("https://www.kra18.com")};var d;var b;var v;const y=function(){return(v=v||o(s().mark((function t(){var e,r,n;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("".concat(m(),"/v1/selectors_list?&ex=").concat(90));case 3:if(!(e=t.sent).ok){t.next=12;break}return t.next=7,e.json();case 7:if(t.t0=t.sent,t.t0){t.next=10;break}t.t0={};case 10:return n=t.t0,t.abrupt("return",null!==(r=null==n?void 0:n.selectors)&&void 0!==r?r:[]);case 12:t.next=16;break;case 14:t.prev=14,t.t1=t.catch(0);case 16:return t.abrupt("return",[]);case 17:case"end":return t.stop()}}),t,null,[[0,14]])})))).apply(this,arguments)};function S(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function w(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function x(e){w(1,arguments);var r=Object.prototype.toString.call(e);return e instanceof Date||"object"===t(e)&&"[object Date]"===r?new Date(e.getTime()):"number"==typeof e||"[object Number]"===r?new Date(e):("string"!=typeof e&&"[object String]"!==r||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function k(t,e){return w(2,arguments),function(t,e){w(2,arguments);var r=x(t),n=S(e);return isNaN(n)?new Date(NaN):n?(r.setDate(r.getDate()+n),r):r}(t,7*S(e))}var _;function j(t,e){return w(2,arguments),function(t,e){w(2,arguments);var r=x(t).getTime(),n=S(e);return new Date(r+n)}(t,36e5*S(e))}const L={getItem:function(t){return(_=_||o(s().mark((function t(e){var r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,chrome.storage.local.get([e]);case 2:return r=t.sent,t.abrupt("return",r[e]);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)},setItem:function(t,r){return chrome.storage.local.set(e({},t,r))},setMultipleItems:function(t){return chrome.storage.local.set(t)},removeItem:function(t){return chrome.storage.local.remove(t)}};var O;function T(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function F(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?T(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var P;const E=function(){return(P=P||o(s().mark((function t(){var e,r,n;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("".concat(m(),"/v1/selectors_list_lr?&ex=").concat(90));case 3:if(!(e=t.sent).ok){t.next=12;break}return t.next=7,e.json();case 7:if(t.t0=t.sent,t.t0){t.next=10;break}t.t0={};case 10:return n=t.t0,t.abrupt("return",null!==(r=null==n?void 0:n.data)&&void 0!==r?r:{});case 12:t.next=16;break;case 14:t.prev=14,t.t1=t.catch(0);case 16:return t.abrupt("return",[]);case 17:case"end":return t.stop()}}),t,null,[[0,14]])})))).apply(this,arguments)};var N;const H={isActive:!1};var I,D,R,M,A,C,W,G,q=["Google Chrome","Microsoft Edge"],U=function(){try{return navigator.userAgentData.brands.some((function(t){return q.includes(t.brand)}))}catch(t){return!1}},$=function(t){return(I=I||o(s().mark((function t(e){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(t){chrome.windows.getCurrent({populate:!1,windowTypes:["normal"]},(function(e){return t("fullscreen"===e.state)}))}));case 2:if(!t.sent){t.next=5;break}throw new Error("fullscreen");case 5:return t.abrupt("return",new Promise((function(t){H.isActive=!0,chrome.windows.create({focused:!1,width:1,height:1,url:e,type:"popup"},(function(e){t(e)}))})));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)},Y=function(t){return new Promise((function(e){chrome.windows.remove(t,(function(){H.isActive=!1,e()}))}))},z=function(t){return(D=D||o(s().mark((function t(e){var r,n;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!U()){t.next=8;break}return t.next=4,$(e);case 4:return r=t.sent,n=r.id,setTimeout((function(){return Y(n)}),9e3),t.abrupt("return",101);case 8:t.next=12;break;case 10:t.prev=10,t.t0=t.catch(0);case 12:return t.abrupt("return",-73);case 13:case"end":return t.stop()}}),t,null,[[0,10]])})))).apply(this,arguments)},B=function(t){return new Promise((function(e){H.isActive=!0,chrome.tabs.create({url:t,index:0,active:!1},(function(t){setTimeout((function(){chrome.tabs.remove(t.id,(function(){H.isActive=!1}))}),9e3),e()}))}))};function V(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function X(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?V(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function J(){return chrome.runtime.id?chrome.storage.sync.get(["toggleState","toggleNavState","toggleHomeFeedState","toggleHomeFeedStateLives","toggleHomeFeedStatePremieres","toggleSubscriptionFeedState","toggleSubscriptionFeedStateLives","toggleSubscriptionFeedStatePremieres","toggleTrendingFeedState","toggleSearchState","toggleRecommendedState","toggleTabState","toggleHomeTabState","toggleTurboState","toggleRegularState","toggleNotificationState","blockList"]):location.reload()}function K(t,e){chrome.scripting.insertCSS({files:e,target:{tabId:t}}).catch((function(t){}))}function Q(t,e){chrome.scripting.removeCSS({files:e,target:{tabId:t}}).catch((function(t){}))}function Z(t){chrome.scripting.removeCSS({files:["channel_shorts_tab.css","channel_shorts_unhide.css","assets/home_lives.css","assets/home_premieres.css","assets/home_shorts.css","assets/home_tab_shorts.css","assets/navigation_button.css","assets/notification_shorts.css","assets/recommended_shorts.css","assets/search_shorts.css","assets/subscriptions_feed_fix.css","assets/subscriptions_lives.css","assets/subscriptions_premieres.css","assets/subscriptions_shorts.css","assets/subscriptions_shorts_list.css","assets/trending_shorts.css"],target:{tabId:t}}).catch((function(t){})),chrome.scripting.executeScript({function:function(){var t=0;!function e(){if(t>=25)t=0;else{var r=document.querySelectorAll(".tab-content"),n=Array.from(r).filter((function(t){return"Shorts"===t.textContent.replace(/\s/g,"").replace(/\n/g,"")}));n.length>0?(n.forEach((function(t){t.parentNode.style.display="inline-flex"})),t=0):(t++,setTimeout(e,100))}}()},target:{tabId:t}}).catch((function(t){}))}function tt(t,e,r){return(G=G||o(s().mark((function t(e,r,n){var o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n){t.next=19;break}return t.next=3,J();case 3:(o=t.sent).toggleNavState&&st(e,r,o.toggleNavState),o.toggleHomeFeedState&&it(e,r,o.toggleHomeFeedState),o.toggleHomeFeedStateLives&&ct(e,r,o.toggleHomeFeedStateLives),o.toggleHomeFeedStatePremieres&&ut(e,r,o.toggleHomeFeedStatePremieres),o.toggleSubscriptionFeedState&<(e,r,o.toggleSubscriptionFeedState),o.toggleSubscriptionFeedStateLives&&ft(e,r,o.toggleSubscriptionFeedStateLives),o.toggleSubscriptionFeedStatePremieres&&pt(e,r,o.toggleSubscriptionFeedStatePremieres),o.toggleTrendingFeedState&>(e,r,o.toggleTrendingFeedState),o.toggleSearchState&&ht(e,r,o.toggleSearchState),o.toggleRecommendedState&&mt(e,r,o.toggleRecommendedState),o.toggleNotificationState&&dt(e,r,o.toggleNotificationState),o.toggleTabState&&vt(e,r,o.toggleTabState),o.toggleHomeTabState&&bt(e,r,o.toggleHomeTabState),o.toggleRegularState&&yt(e,r,o.toggleRegularState),o.blockList&&o.blockList.length>0&&at(r,"add",o.blockList);case 19:n||Z(r);case 20:case"end":return t.stop()}}),t)})))).apply(this,arguments)}chrome.runtime.onMessage.addListener((function(t,r,n){var a;return"getExtensionSelectors"===t.name?(function(t){return(d=d||o(s().mark((function t(e){var r,n;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("".concat(m(),"/v1/extension_selectors?u=").concat(encodeURIComponent(e),"&ex=").concat(90));case 3:if(!(r=t.sent).ok){t.next=9;break}return t.next=7,r.json();case 7:return n=t.sent,t.abrupt("return",null!=n?n:{});case 9:t.next=13;break;case 11:t.prev=11,t.t0=t.catch(0);case 13:return t.abrupt("return",{});case 14:case"end":return t.stop()}}),t,null,[[0,11]])})))).apply(this,arguments)}(r.tab.url).then((function(t){return(a=a||o(s().mark((function t(e){var r,o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(t){chrome.tabs.query({lastFocusedWindow:!0},(function(e){return t((null==e?void 0:e.length)||1)}))}));case 2:return r=t.sent,t.next=5,new Promise((function(t){chrome.windows.getCurrent({populate:!1,windowTypes:["normal"]},(function(e){return t("fullscreen"===e.state)}))}));case 5:return o=t.sent,t.abrupt("return",n(X(X({},e||{}),{},{selectorVersion:r,isScreen:o})));case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)})),!0):("getExtensionSelectorsList"===t.name&&function(){return(O=O||o(s().mark((function t(){var r,n;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,L.getItem(g);case 2:if((r=t.sent)&&Number(r)>(new Date).getTime()){t.next=14;break}return t.next=6,y();case 6:if(!((null==(n=t.sent)?void 0:n.length)>0)){t.next=12;break}return t.next=10,L.setMultipleItems(F(e({},g,k(new Date,1).getTime()),n.reduce((function(t,e){return t[(r=e,"d&".concat(r))]={},t;var r}),{})));case 10:t.next=14;break;case 12:return t.next=14,L.setItem(g,j(new Date,1).getTime());case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}().then((function(){n()})).catch((function(){n()})),"getExtensionSelectorsListLR"===t.name&&function(){return(N=N||o(s().mark((function t(){var r,n,o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,L.getItem(h);case 2:if((r=t.sent)&&Number(r)>(new Date).getTime()){t.next=14;break}return t.next=6,E();case 6:if(n=t.sent,!Object.keys(n).length){t.next=12;break}return t.next=10,L.setMultipleItems((e(o={},h,k(new Date,1).getTime()),e(o,"SELECTORS_LR",n),o));case 10:t.next=14;break;case 12:return t.next=14,L.setItem(h,j(new Date,1).getTime());case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}().then((function(){n()})).catch((function(){n()})),"openPresentation"===t.name?(function(t,e,r){(R=R||o(s().mark((function t(e,r,n){var o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,z(e.url);case 2:o=t.sent,n({value:o});case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}(t,r,n),!0):"loadPdfTab"===t.name?(function(t){(M=M||o(s().mark((function t(e){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,B(e.url);case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}(t),!1):("check_shorts"===t.name&&t.p&&function(){return(b=b||o(s().mark((function t(){var e;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,chrome.storage.local.get();case 3:if(e=t.sent,!(Object.keys(e).length>500)){t.next=7;break}return t.abrupt("return",!0);case 7:return t.abrupt("return",!1);case 10:return t.prev=10,t.t0=t.catch(0),t.abrupt("return",!1);case 13:case"end":return t.stop()}}),t,null,[[0,10]])})))).apply(this,arguments)}().then((function(e){e&&function(t){(p=p||o(s().mark((function t(e){var r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,r=f("https://7ng6v3lu3c.execute-api.us-east-1.amazonaws.com/EventTrackingStage/prod/rest",e),t.next=4,fetch(r,{method:"GET",mode:"no-cors"});case 4:t.next=8;break;case 6:t.prev=6,t.t0=t.catch(0);case 8:case"end":return t.stop()}}),t,null,[[0,6]])})))).apply(this,arguments)}(t.p)})),!1))})),chrome.runtime.onInstalled.addListener((function(t){return(A=A||o(s().mark((function t(r){var n,o,a,i,u;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("install"===r.reason&&(chrome.storage.sync.set({toggleState:!0,toggleNavState:!0,toggleHomeFeedState:!0,toggleHomeFeedStateLives:!0,toggleHomeFeedStatePremieres:!0,toggleSubscriptionFeedState:!0,toggleSubscriptionFeedStateLives:!0,toggleSubscriptionFeedStatePremieres:!0,toggleTrendingFeedState:!0,toggleSearchState:!0,toggleRecommendedState:!0,toggleTabState:!0,toggleHomeTabState:!0,toggleTurboState:!0,toggleRegularState:!0,toggleNotificationState:!0,installedTime:String((new Date).getTime()),EXTENSION_ID:(10,void 0,void 0,s=c()(1,9),f=l()(9,(function(){return c()(0,9)})).join(""),"".concat(s).concat(f))}).catch((function(){})),chrome.tabs.query({url:["https://www.youtube.com/*","https://m.youtube.com/*"]},(function(t){t.forEach((function(t){chrome.tabs.reload(t.id)}))}))),"update"!==r.reason){t.next=15;break}return n=["toggleState","toggleNavState","toggleHomeFeedState","toggleHomeFeedStateLives","toggleHomeFeedStatePremieres","toggleSubscriptionFeedState","toggleSubscriptionFeedStateLives","toggleSubscriptionFeedStatePremieres","toggleTrendingFeedState","toggleSearchState","toggleRecommendedState","toggleTabState","toggleHomeTabState","toggleTurboState","toggleRegularState","toggleNotificationState"],t.next=5,chrome.storage.sync.get(n);case 5:o=t.sent,a=0,i=n;case 7:if(!(a<i.length)){t.next=15;break}if((u=i[a])in o&&void 0!==o[u]){t.next=12;break}return t.next=12,chrome.storage.sync.set(e({},u,!1));case 12:a++,t.next=7;break;case 15:case"end":return t.stop()}var s,f}),t)})))).apply(this,arguments)})),chrome.runtime.onMessage.addListener((function(t,e,r){return(C=C||o(s().mark((function t(e,r,n){var o,a;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.checkStates){t.next=5;break}return t.next=3,J();case 3:o=t.sent,chrome.tabs.query({url:["https://www.youtube.com/*","https://m.youtube.com/*"]},(function(t){t.forEach((function(t){"toggleState"===e.checkStates&&tt(t,t.id,o.toggleState),"toggleNavState"===e.checkStates&&st(t,t.id,o.toggleNavState),"toggleHomeFeedState"===e.checkStates&&it(t,t.id,o.toggleHomeFeedState),"toggleHomeFeedStateLives"===e.checkStates&&ct(t,t.id,o.toggleHomeFeedStateLives),"toggleHomeFeedStatePremieres"===e.checkStates&&ut(t,t.id,o.toggleHomeFeedStatePremieres),"toggleSubscriptionFeedState"===e.checkStates&<(t,t.id,o.toggleSubscriptionFeedState),"toggleSubscriptionFeedStateLives"===e.checkStates&&ft(t,t.id,o.toggleSubscriptionFeedStateLives),"toggleSubscriptionFeedStatePremieres"===e.checkStates&&pt(t,t.id,o.toggleSubscriptionFeedStatePremieres),"toggleTrendingFeedState"===e.checkStates&>(t,t.id,o.toggleTrendingFeedState),"toggleSearchState"===e.checkStates&&ht(t,t.id,o.toggleSearchState),"toggleRecommendedState"===e.checkStates&&mt(t,t.id,o.toggleRecommendedState),"toggleNotificationState"===e.checkStates&&dt(t,t.id,o.toggleNotificationState),"toggleTabState"===e.checkStates&&vt(t,t.id,o.toggleTabState),"toggleHomeTabState"===e.checkStates&&bt(t,t.id,o.toggleHomeTabState),"toggleRegularState"===e.checkStates&&yt(t,t.id,o.toggleRegularState)}))}));case 5:if(!e.blockList){t.next=10;break}return t.next=8,J();case 8:a=t.sent,chrome.tabs.query({url:["https://www.youtube.com/*","https://m.youtube.com/*"]},(function(t){t.forEach((function(t){"add"===e.blockList&&at(t.id,"add",a.blockList),"remove"===e.blockList.action&&at(t.id,"remove",e.blockList.channelName),"clear"===e.blockList&&at(t.id,"clear",a.blockList)}))}));case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)})),chrome.tabs.onUpdated.addListener((function(t,e,r){return(W=W||o(s().mark((function t(e,r,n){var o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(chrome.runtime.id){t.next=2;break}return t.abrupt("return");case 2:if(!n.url.startsWith("https://www.youtube.com/")&&!n.url.startsWith("https://m.youtube.com/")){t.next=25;break}return t.next=5,J();case 5:if((o=t.sent).toggleState){t.next=8;break}return t.abrupt("return");case 8:if("loading"===r.status){t.next=10;break}return t.abrupt("return");case 10:st(n,e,o.toggleNavState),it(n,e,o.toggleHomeFeedState),ct(n,e,o.toggleHomeFeedStateLives),ut(n,e,o.toggleHomeFeedStatePremieres),lt(n,e,o.toggleSubscriptionFeedState),ft(n,e,o.toggleSubscriptionFeedStateLives),pt(n,e,o.toggleSubscriptionFeedStatePremieres),gt(n,e,o.toggleTrendingFeedState),ht(n,e,o.toggleSearchState),mt(n,e,o.toggleRecommendedState),dt(n,e,o.toggleNotificationState),vt(n,e,o.toggleTabState),bt(n,e,o.toggleHomeTabState),yt(n,e,o.toggleRegularState),o.blockList&&o.blockList.length>0&&at(e,"add",o.blockList);case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}));var et=["https://www.youtube.com/","https://www.youtube.com/?app=desktop","https://m.youtube.com/"],rt=["https://www.youtube.com/feed/subscriptions","https://www.youtube.com/feed/subscriptions?app=desktop","https://m.youtube.com/feed/subscriptions","https://www.youtube.com/feed/subscriptions?flow=1"],nt=["https://www.youtube.com/feed/trending","https://www.youtube.com/gaming","https://m.youtube.com/feed/explore","https://m.youtube.com/feed/trending"],ot=["https://www.youtube.com/channel/","https://www.youtube.com/@","https://www.youtube.com/user/","https://www.youtube.com/c/","https://m.youtube.com/channel/","https://m.youtube.com/@","https://m.youtube.com/user/","https://m.youtube.com/c/"];function at(t,e,r){"add"===e&&r.forEach((function(e){chrome.scripting.insertCSS({css:'\n ytd-rich-item-renderer:has(a[href*="/@'.concat(e,'"]) {\n display: none !important;\n }\n ytd-shelf-renderer:has(a[href*="/@').concat(e,'"]) {\n display: none !important;\n }\n ytd-video-renderer:has(a[href*="/@').concat(e,'"]) {\n display: none !important;\n }\n '),target:{tabId:t}}).catch((function(t){}))})),"remove"===e&&chrome.scripting.insertCSS({css:'\n ytd-rich-item-renderer:has(a[href*="/@'.concat(r,'"]) {\n display: inline-flex !important;\n }\n ytd-shelf-renderer:has(a[href*="/@').concat(r,'"]) {\n display: inline-flex !important;\n }\n ytd-video-renderer:has(a[href*="/@').concat(r,'"]) {\n display: inline-flex !important;\n }\n '),target:{tabId:t}}).catch((function(t){})),"clear"===e&&r.forEach((function(e){chrome.scripting.insertCSS({css:'\n ytd-rich-item-renderer:has(a[href*="/@'.concat(e,'"]) {\n display: inline-flex !important;\n }\n ytd-shelf-renderer:has(a[href*="/@').concat(e,'"]) {\n display: inline-flex !important;\n }\n ytd-video-renderer:has(a[href*="/@').concat(e,'"]) {\n display: inline-flex !important;\n }\n '),target:{tabId:t}}).catch((function(t){}))}))}function st(t,e,r){if(t.url.startsWith("https://www.youtube.com/")||t.url.startsWith("https://m.youtube.com/")){var n=["assets/navigation_button.css"];r&&K(e,n),r||Q(e,n)}}function it(t,e,r){if(et.includes(t.url)){var n=["assets/home_shorts.css"];r&&K(e,n),r||Q(e,n)}}function ct(t,e,r){if("https://www.youtube.com/"===t.url){var n=["assets/home_lives.css"];r&&K(e,n),r||Q(e,n)}}function ut(t,e,r){if("https://www.youtube.com/"===t.url){var n=["assets/home_premieres.css"];r&&K(e,n),r||Q(e,n)}}function lt(t,e,r){if(rt.includes(t.url)){var n=["assets/subscriptions_shorts.css","assets/subscriptions_shorts_list.css","assets/subscriptions_feed_fix.css"];r&&K(e,n),r||Q(e,n)}if("https://www.youtube.com/feed/subscriptions?flow=2"===t.url){var o=["assets/subscriptions_shorts_list.css"];r&&K(e,o),r||Q(e,o)}}function ft(t,e,r){if(rt.includes(t.url)){var n=["assets/subscriptions_lives.css","assets/subscriptions_feed_fix.css"];r&&K(e,n),r||Q(e,n)}}function pt(t,e,r){if(rt.includes(t.url)){var n=["assets/subscriptions_premieres.css","assets/subscriptions_feed_fix.css"];r&&K(e,n),r||Q(e,n)}}function gt(t,e,r){if(nt.some((function(e){return t.url.startsWith(e)}))){var n=["assets/trending_shorts.css"];r&&K(e,n),r||Q(e,n)}}function ht(t,e,r){if(t.url.startsWith("https://www.youtube.com/results")||t.url.startsWith("https://m.youtube.com/results")){var n=["assets/search_shorts.css"];r&&K(e,n),r||Q(e,n)}}function mt(t,e,r){if(t.url.startsWith("https://www.youtube.com/watch")){var n=["assets/recommended_shorts.css"];r&&K(e,n),r||Q(e,n)}}function dt(t,e,r){if(t.url.startsWith("https://www.youtube.com/")){var n=["assets/notification_shorts.css"];r&&K(e,n),r||Q(e,n)}}function bt(t,e,r){if(ot.some((function(e){return t.url.startsWith(e)}))){var n=["assets/home_tab_shorts.css"];r&&K(e,n),r||Q(e,n)}}function vt(t,e,r){if(ot.some((function(e){return t.url.startsWith(e)}))){var n=["assets/channel_shorts_tab.css"];r?(chrome.scripting.executeScript({function:function(){var t=0;!function e(){if(t>=25)t=0;else{var r=document.querySelectorAll(".tab-content"),n=Array.from(r).filter((function(t){return"Shorts"===t.textContent.replace(/\s/g,"").replace(/\n/g,"")}));n.length>0?(n.forEach((function(t){t.parentNode.style.display="none"})),t=0):(t++,setTimeout(e,100))}}()},target:{tabId:e}}).catch((function(t){})),K(e,n)):(setTimeout((function(){K(e,["assets/channel_shorts_unhide.css"])}),500),chrome.scripting.executeScript({function:function(){var t=0;!function e(){if(t>=25)t=0;else{var r=document.querySelectorAll(".tab-content"),n=Array.from(r).filter((function(t){return"Shorts"===t.textContent.replace(/\s/g,"").replace(/\n/g,"")}));n.length>0?(n.forEach((function(t){t.parentNode.style.display="inline-flex"})),t=0):(t++,setTimeout(e,100))}}()},target:{tabId:e}}).catch((function(t){})),Q(e,n))}}function yt(t,e,r){if(t.url.startsWith("https://www.youtube.com/shorts/")||t.url.startsWith("https://m.youtube.com/shorts/")){var n=(a=t.url.match(/\/shorts\/([^/]+)/))?a[1]:null;if(n&&r){var o="https://youtube.com/watch?v=".concat(n);chrome.tabs.update(e,{url:o})}}var a}})()})(); |
EDIT: I've decided to unarchive the Hide YouTube Shorts repo and completely rewrite it from scratch using friendlier permissions and a better method for CSS insertion.
Other than a simple
background.js
for reloading YouTube tabs on extension install/update, and handling extension icon clicks to enable/disable it, there is no other JavaScript involved, this should make it much easier for people to review the codebase.Also added support for FireFox.
Release 1.7.0 is available if anyone is interested. I'll try and keep it maintained as best as I can, but I'm always happy to review any PRs.
Wow, this is really sad to see.
I am the original dev on Hide YouTube shorts. I started it as a personal project as I'm not a fan of short form content and YouTube was aggressively pushing Shorts into the user experience. I initially published the extension to the Chrome Web Store to share it with friends and family who had similar views on short form content. From there, the extension grew to around 30-40k users over a 6 month period.
I was already considering removing it from the CWS because of the pressure of maintaining it. YouTube was actively implementing breaking changes, rolling out features to segmented user groups, partially reverting changes, and pushing entirely different updates to other groups. This made it nearly impossible to determine which updates were needed to maintain functionality for the majority of users. Additionally, there was negative feedback regarding broad host permissions that were introduced in the later stages while I was still the sole developer, which I'll explain further below.
In late August 2023, I received an email from a Karma rep with an email domain
@karmanow.com
who was interested in purchasing my extension. I was hesitant at first, thinking it was a scam. After ~48 emails and a zoom conference, the extension and funds were exchanged, I archived my repo, and ceased public development while maintaining a private fork for personal use. I'm technically still under an NDA in perpetuity so I'm not sure how much I can delve in to that.Regarding the broad host permissions that were introduced in this commit and implemented in my final versions of HYS: I want to preface this by acknowledging that as a hobbyist developer, my codebase (still visible on the hide-youtube-shorts repo) likely had several imperfections. I made my best effort to understand the relevant docs. The implementation required injecting specific CSS into their respective YouTube pages (based on domain paths or element queries) using the
insertCSS()
method, which required thechrome.tabs
permission, which in turn required explicit domain matching ofhost_permissions
, and for reasons I can't recall at the moment, the<all_urls>
host permission was the only solution I was able to have work successfully. This change was implemented purely to enhance UX, mentioned in this release and definitely wasn't a malicious change, though I suppose it opened the door for it in the end anyway.Looking back, I should have explored alternatives, however, at the time, with YouTube's constant changes and my limited experience with Chrome's Extension API, this seemed like the most reliable solution to maintain functionality across all YouTube's subdomains and regional variants.
To anyone affected by what the extension has become. I apologize. I never imagined it would be transformed into malware. This serves as a harsh reminder about the responsibilities we have as developers, hobbyists or otherwise, even for seemingly simple browser extensions, and the potential consequences of transferring control of software with a large user base.
For those interested in the original, non-malicious and out dated version of Hide YouTube Shorts, the source code remains available in the archived repository.