F95 Compressed button

Added a 'compressed' search button

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
    //Ver Compressed
    var button1 = '<input type="button" value="New+Compressed" ' +
        'style="position: fixed; top: 25%; right: 120px; z-index: 9999;line-height: 30px;font-size: 20px; ">';
    jQuery('body').append(button1);
    var labelAppend = document.querySelector('div.p-title h1.p-title-value');
    var match = labelAppend.textContent.match(/\[(.*?)\]/);
    var extractedString = match[1] + ' Compressed';
    jQuery('body').on('click', 'input[type="button"][value="New+Compressed"]', function() {

        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();
            }
        }
    });
	
	//Compressed
    var button4 = '<input type="button" value="Compressed" ' +
        'style="position: fixed; top: 30%; right: 120px; z-index: 9999;line-height: 30px;font-size: 20px; ">';
    jQuery('body').append(button4);
    jQuery('body').on('click', 'input[type="button"][value="Compressed"]', function() {
        const searchInput = document.querySelector('.uix_searchInput');
        if (searchInput) {
            searchInput.value = 'Compressed';
            const event = new Event('input', { bubbles: true });
            searchInput.dispatchEvent(event);
            const searchButton = document.querySelector('button.button--primary.button--icon--search');
            if (searchButton) {
                searchButton.click();
            }
        }
    });
}