VK Blur Exterminator

Removes blur layers and age-restriction overlays, fills blank thumbnail previews on VK.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name        VK Blur Exterminator
// @namespace   Violentmonkey Scripts
// @version     1.1.0
// @license     MIT
// @match       https://m.vkvideo.ru/*
// @match       https://www.vkvideo.ru/*
// @match       https://vkvideo.ru/*
// @grant       none
// @run-at      document-start
// @author      tarangogo
// @description Removes blur layers and age-restriction overlays, fills blank thumbnail previews on VK.
// ==/UserScript==
(function () {
    'use strict';

    /* ── CSS ── */
    const style = document.createElement('style');
    style.textContent = `
        [class*="VideoCardRestrictionOverlay"],
        [class*="VideoPreviewOverlay"],
        [class*="RestrictionOverlay"],
        [class*="AgeRestriction"],
        [class*="adult_warning"] {
            display: none !important;
        }
        [class*="VideoCard"] img,
        [class*="VideoCard"] video,
        [class*="videoCard"] img,
        [class*="videoCard"] video {
            filter: none !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
        }
        [style*="blur"] {
            filter: none !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
        }
        /* Force preview image containers to be visible */
        [class*="VideoCardPreviewImage__container"] {
            opacity: 1 !important;
            visibility: visible !important;
            display: block !important;
        }
    `;

    const injectStyle = () => {
        (document.head || document.documentElement).appendChild(style);
    };

    if (document.head) {
        injectStyle();
    } else {
        new MutationObserver((_, obs) => {
            if (document.head) {
                injectStyle();
                obs.disconnect();
            }
        }).observe(document.documentElement, { childList: true });
    }

    /* ── JS ── */
    const OVERLAY_PATTERNS = [
        'VideoCardRestrictionOverlay',
        'VideoPreviewOverlay',
        'RestrictionOverlay',
        'AgeRestriction',
        'adult_warning',
        'hide_outline_28',
    ];

    const removeOverlays = () => {
        OVERLAY_PATTERNS.forEach(pattern => {
            document.querySelectorAll(`[class*="${pattern}"]`).forEach(el => {
                const tag = el.tagName.toLowerCase();
                if (!['img', 'video', 'source'].includes(tag)) {
                    el.remove();
                }
            });
        });

        // Auto-click age-confirmation buttons
        document.querySelectorAll(
            'button[class*="confirm"], button[class*="Adult"], button[class*="adult"], button[class*="Confirm"]'
        ).forEach(btn => {
            if (btn.offsetParent !== null) btn.click();
        });

        // Strip inline blur styles
        document.querySelectorAll('[style*="blur"], [style*="filter"]').forEach(el => {
            el.style.removeProperty('filter');
            el.style.removeProperty('backdrop-filter');
            el.style.removeProperty('-webkit-backdrop-filter');
        });

        // Fix missing containerVisible class on preview image containers
        document.querySelectorAll('[class*="VideoCardPreviewImage__container"]').forEach(el => {
            const hasVisible = [...el.classList].some(c => c.includes('containerVisible'));
            if (!hasVisible) {
                const visibleEl = document.querySelector('[class*="containerVisible"]');
                if (visibleEl) {
                    const visibleClass = [...visibleEl.classList].find(c => c.includes('containerVisible'));
                    if (visibleClass) el.classList.add(visibleClass);
                } else {
                    el.style.opacity = '1';
                    el.style.visibility = 'visible';
                }
            }
        });
    };

    const start = () => {
        removeOverlays();
        new MutationObserver(removeOverlays).observe(document.body, {
            childList: true,
            subtree: true,
        });
    };

    if (document.body) {
        start();
    } else {
        document.addEventListener('DOMContentLoaded', start, { once: true });
    }
})();