icons8 SVG Embed Paywall Bypass

ONLY removes paywall overlay + makes native button work

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         icons8 SVG Embed Paywall Bypass
// @namespace    http://tampermonkey.net/
// @version      1.4
// @description  ONLY removes paywall overlay + makes native button work
// @author       InternetNinja
// @match        *://icons8.com/*
// @grant        none
// @run-at       document-end
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const style = document.createElement('style');
    style.textContent = `
        .i8-code__locked {
            display: none !important;
        }
        .i8-code__code-text {
            filter: none !important;
            -webkit-filter: none !important;
            user-select: text !important;
            -webkit-user-select: text !important;
        }
    `;
    document.head.appendChild(style);

    function fixPaywall() {
        document.querySelectorAll('.i8-code__code-text').forEach(codeEl => {
            // Remove overlay if present
            const overlay = codeEl.closest('.i8-code__wrapper')?.querySelector('.i8-code__locked');
            if (overlay) overlay.remove();

            // Only add button if no native button exists
            if (!codeEl.querySelector('.i8-code__copy-btn')) {
                const btn = document.createElement('button');
                btn.className = 'i8-code__copy-btn';
                btn.innerHTML = `<img src="https://maxst.icons8.com/vue-static/icon/svg/copy.svg" alt="copy">`;
                btn.onclick = () => navigator.clipboard.writeText(codeEl.textContent);
                codeEl.appendChild(btn);
            }
        });
    }

    // Run multiple times to catch dynamic content
    const runFix = () => setTimeout(fixPaywall, 100);

    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', runFix);
    } else {
        runFix();
    }

    new MutationObserver(runFix).observe(document.body, { childList: true, subtree: true });

    // Run periodically for SPA sites
    setInterval(runFix, 2000);
})();