// ==UserScript==
// https://www.reddit.com/r/qutebrowser/comments/u05nix/skipping_youtube_ads/
// https://www.reddit.com/r/qutebrowser/comments/tue1gs/blocking_youtube_ads/
// u/name         Auto Skip YouTube Ads
// u/version      1.0.0
// u/description  Speed up and skip YouTube ads automatically
// u/author       jso8910
// u/match        *://*.youtube.com/*
// u/exclude      *://*.youtube.com/subscribe_embed?*
// ==/UserScript==
const btn = document.querySelector('.videoAdUiSkipButton,.ytp-ad-skip-button')
if (btn) {
    btn.click()
}

const ad = [...document.querySelectorAll('.ad-showing')][0];
if (ad) {
    const vid = document.querySelector('video');
    vid.currentTime = vid.duration;
}
