Отключение безопасного просмотра ВК

Добавляет кнопку для отключения безопасного поиска видео = можно искать порно

目前為 2024-09-16 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Отключение безопасного просмотра ВК
// @version      1.2
// @description  Добавляет кнопку для отключения безопасного поиска видео = можно искать порно
// @author       awaw
// @match        https://vk.com/*
// @grant        none
// @license      MIT
// @namespace awaw
// ==/UserScript==

(function() {
    'use strict';

    function addButton() {
        if (window.location.href.includes('/video') && !document.querySelector('#notsafeButton')) {
            const button = document.createElement('button');
            button.id = 'notsafeButton';
            button.innerText = 'Вкл 18+';
            button.style.position = 'fixed';
            button.style.top = '6px';
            button.style.right = '6px';
            button.style.padding = '6px';
            button.style.color = 'white';
            button.style.border = 'none';
            button.style.borderRadius = '6px';
            button.style.cursor = 'pointer';
            button.style.zIndex = '9999';

            document.body.appendChild(button);

            button.addEventListener('click', function() {
                let currentUrl = window.location.href;
                if (currentUrl.includes('?')) {
                    currentUrl += '&notsafe=1';
                } else {
                    currentUrl += '?notsafe=1';
                }
                window.location.href = currentUrl;
            });
        }
    }

    addButton();

    const observer = new MutationObserver(() => {
        addButton();
    });

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

QingJ © 2025

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