F95 Compressed button

Added a 'Current version compressed' search button

// ==UserScript==
// @name         F95 Compressed button
// @namespace    http://tampermonkey.net/
// @description  Added a 'Current version compressed' search button
// @version      1
// @author       You
// @match        https://f95zone.to/threads/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=f95zone.to
// @grant        none
// ==/UserScript==
{

    var pTitleElements = document.querySelector('div.p-title');
    var button = document.createElement('button');
    button.textContent = 'Compressed';
    button.addEventListener('click', function() {
        var labelAppend = pTitleElements.querySelector('h1.p-title-value');
        if (labelAppend) {
            var match = labelAppend.textContent.match(/\[(.*?)\]/);
            if (match) {
                var extractedString = match[1] + ' Compressed  ';
                const searchInput = document.querySelector('.uix_searchInput');
                if (searchInput) {
                    searchInput.value = extractedString;
                    const event = new Event('input', { bubbles: true });
                    searchInput.dispatchEvent(event);
                    const searchButton = document.querySelector('button.button--primary.button--icon--search');
                    if (searchButton) {
                        searchButton.click();
                    }
                }
            }
        }

    });
    pTitleElements.appendChild(button);
}

QingJ © 2025

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