Unlock photo Ayaznal.ru

Unlock photo

// ==UserScript==
// @name         Unlock photo Ayaznal.ru
// @namespace    http://tampermonkey.net/
// @version      2024-11-01
// @description  Unlock photo
// @author       Vierta
// @match        https://ayaznal.ru/photo/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=ayaznal.ru
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function applyModifications() {
        const passX = document.getElementById("pass_x");
        if (passX) {
            passX.style.display = "none";
        }
        const passPassword = document.getElementById("pass_password");
        if (passPassword) {
            passPassword.value = "";
        }

        const remocalClose = document.querySelector('.remodal-close');
        if (remocalClose) {
            remocalClose.click();
        }
        const polomanPro = document.getElementById("poloman_pro");
        if (polomanPro) {
            polomanPro.classList.add('pass_view_photo');
            polomanPro.classList.remove('pass_noview_photo');
        }
        const body = document.body;
        if (body) {
            body.classList.add('pass_view_ph');
            body.classList.remove('pass_noview_ph');
        }
        const vipSpans = document.querySelectorAll('span.vip');
        vipSpans.forEach(span => {
            span.remove();
        });
        const ulightboxElements = document.querySelectorAll('.ulightbox');
        ulightboxElements.forEach(element => {
            element.className = element.className.replace('ulightbox', 'hb-section ulightbox');
        });
    }
    window.addEventListener('load', applyModifications);
    const observer = new MutationObserver(function(mutations) {
        applyModifications();
    });
    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
})();