summaryrefslogtreecommitdiff
path: root/ar/.config/qutebrowser/greasemonkey/youtube-ads.js
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-02-10 08:24:09 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-02-10 08:24:09 +0900
commit8db391ce6ca07ec78780c782a204abee357d73d0 (patch)
tree97df2788261b86c9e2cb1bb45116ebc51c55af71 /ar/.config/qutebrowser/greasemonkey/youtube-ads.js
parent9a1d363908228a4d9fffec191aff106598a6ac27 (diff)
modified qutebrowser/config.py, modified bin/bookmarks, created greasemonkey/, created bin/umpv
Diffstat (limited to 'ar/.config/qutebrowser/greasemonkey/youtube-ads.js')
-rw-r--r--ar/.config/qutebrowser/greasemonkey/youtube-ads.js23
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,
+);