Ad Skipper for Spotify Web Player

Automatically skip ads on Spotify.

As of 2025-08-14. See the latest version.

// ==UserScript==
// @name         Ad Skipper for Spotify Web Player
// @namespace    http://tampermonkey.net/
// @version      1.2.0
// @description  Automatically skip ads on Spotify.
// @author       Tomoyuki Kawao
// @match        https://open.spotify.com/*
// @license      MIT
// @grant        none
// @run-at       document-start
// ==/UserScript==

document.createElement = function(originalCreateElement) {
    return function() {
        var element = originalCreateElement.apply(this, arguments);
        if (element instanceof HTMLMediaElement) {
            element.addEventListener("play", (event) => {
                if (!event.currentTarget.src.startsWith("blob:https://open.spotify.com/") && event.currentTarget.duration < 40.0) {
                    let target = event.currentTarget;
                    setTimeout(() => {
                        target.currentTime = target.duration;
                    }, 1);
                }
            });
        }
        return element;
    };
}(document.createElement);
长期地址
遇到问题?请前往 GitHub 提 Issues。