diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-02-17 09:16:56 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-02-17 09:16:56 +0900 |
| commit | b930c710a29410daa2368258db69d9830a656c5d (patch) | |
| tree | 5665d798d2601619940230a0e6dfaecd61dcab57 /ar/.config/qutebrowser/greasemonkey/youtube-ads.js | |
| parent | 6560acee5bf5fce09b6ced1c9a3d3d111459878d (diff) | |
updates
Diffstat (limited to 'ar/.config/qutebrowser/greasemonkey/youtube-ads.js')
| -rw-r--r-- | ar/.config/qutebrowser/greasemonkey/youtube-ads.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ar/.config/qutebrowser/greasemonkey/youtube-ads.js b/ar/.config/qutebrowser/greasemonkey/youtube-ads.js new file mode 100644 index 0000000..21d4214 --- /dev/null +++ b/ar/.config/qutebrowser/greasemonkey/youtube-ads.js @@ -0,0 +1,23 @@ +// ==UserScript== +// @name Skip YouTube ads +// @description Skips the ads in YouTube videos +// @run-at document-start +// @include *.youtube.com/* +// ==/UserScript== + +document.addEventListener( + "load", + () => { + const btn = document.querySelector( + ".videoAdUiSkipButton,.ytp-ad-skip-button-modern", + ); + if (btn) { + btn.click(); + } + const ad = [...document.querySelectorAll(".ad-showing")][0]; + if (ad) { + document.querySelector("video").currentTime = 9999999999; + } + }, + true, +); |
