F95Zone Developer Search

Adds a button to search for the developer on f95zone

Stan na 29-05-2024. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         F95Zone Developer Search
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Adds a button to search for the developer on f95zone
// @author       FunkyJustin
// @license      MIT
// @match        https://f95zone.to/threads/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=f95zone.to
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to create the search button
    function createSearchButton(developerName) {
        const button = document.createElement('button');
        button.innerText = 'Search Developer';
        button.style.marginLeft = '10px';
        button.style.cursor = 'pointer';
        button.onclick = function() {
            const searchUrl = `https://f95zone.to/sam/latest_alpha/#/cat=games/page=1/creator=${developerName}`;
            window.open(searchUrl, '_blank');
        };
        return button;
    }

    // Find the title element
    const titleElement = document.querySelector('.p-title h1.p-title-value');
    if (titleElement) {
        // Extract the developer's name
        const titleText = titleElement.innerText;
        const developerMatch = titleText.match(/\[([^\]]+)\]$/);
        if (developerMatch) {
            const developerName = developerMatch[1];
            const searchButton = createSearchButton(developerName);

            // Append the button next to the title
            titleElement.appendChild(searchButton);
        }
    }
})();