F95 Compressed button

Added a 'compressed' search button

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==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();
            }
        }
    });
}