Ad Skipper for Spotify Web Player

Automatically skip ads on Spotify.

目前為 2025-05-22 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Ad Skipper for Spotify Web Player
// @namespace    http://tampermonkey.net/
// @version      1.0.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 (document.querySelector("[data-testadtype=\"ad-type-ad\"]")) {
                    event.currentTarget.currentTime = Number.isFinite(event.currentTarget.duration) ? event.currentTarget.duration : 30.0;
                }
            });
        }
        return element;
    };
}(document.createElement);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址