EpidemicSound NoTrial

Hides the trial popup and allows you to scroll without trial subscription on Epidemic Sound.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         EpidemicSound NoTrial
// @namespace    -
// @version      1.6
// @description  Hides the trial popup and allows you to scroll without trial subscription on Epidemic Sound.
// @author       Cat-Ling
// @homepageURL  https://github.com/Cat-Ling
// @icon         https://www.google.com/s2/favicons?sz=64&domain=www.epidemicsound.com
// @match        *://*.epidemicsound.com/*
// @exclude      *://login.epidemicsound.com/*
// @license      GPL-3.0
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const enforceScrollbar = () => {
        const style = document.createElement('style');
        style.textContent = `
            html, body {
                overflow: auto !important;
            }
            ::-webkit-scrollbar {
                display: block !important;
            }
        `;
        document.head.appendChild(style);
    };

    const hideBackdrop = () => {
        document.querySelectorAll("[class*='_backdrop_']").forEach((element) => {
            element.style.display = 'none';
        });
    };

    enforceScrollbar();
    hideBackdrop();

    const observer = new MutationObserver(() => {
        enforceScrollbar();
        hideBackdrop();
    });

    observer.observe(document.body, { childList: true, subtree: true });
})();