summaryrefslogtreecommitdiff
path: root/ar/.config/qutebrowser/greasemonkey/youtube.css.js
blob: 6807ff33a52a54ec705dcfc86d7d80bc2fbddd38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// ==UserScript==
// @name        YouTube
// @include     *://*.youtube.com/*
// ==/UserScript==

/* ~/.config/qutebrowser/greasemonkey/youtube.css.js :: */

document.addEventListener(
  "load",
  () => {
    try {
      document.querySelector(".ad-showing video").currentTime = 99999;
    } catch {}
    try {
      document.querySelector(".ytp-ad-skip-button").click();
    } catch {}
  },
  true,
);

GM_addStyle(`
  ytd-compact-promoted-video-renderer,
  .ytd-action-companion-ad-renderer,
  .ytd-ad-slot-renderer,
  .ytd-promoted-sparkles-web-renderer {
    display: none !important;
  },
  .ytp-gradient-bottom {
    display: none !important
  }
`);