Renderosity Tools

Custom tools for Renderosity

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Renderosity Tools
// @namespace   Violentmonkey Scripts
// @match       https://www.renderosity.com/*
// @icon        https://www.renderosity.com/favicon.ico
// @grant       none
// @version     1.2
// @description Custom tools for Renderosity
// @license     MIT
// ==/UserScript==

(function () {

    // ----------------------------------------------------
    // Helper: convert spaces → plus signs
    // ----------------------------------------------------
    function plusify(str) {
        return str.trim().split(" ").join("+");
    }

    // ----------------------------------------------------
    // Helper: extract product title from page
    // ----------------------------------------------------
    function getProductTitle() {
        const el = document.querySelector(".rr-mktproduct-title");
        if (!el) return null;
        return el.textContent.trim();
    }

    // ----------------------------------------------------
    // Only show floating buttons on product pages
    // ----------------------------------------------------
    if (location.href.startsWith("https://www.renderosity.com/marketplace/products/")) {

        // -----------------------------
        // Button 1: Search Render-State
        // -----------------------------
        const btn1 = document.createElement("button");
        btn1.textContent = "Search Render‑State";
        btn1.style.position = "fixed";
        btn1.style.top = "10px";
        btn1.style.right = "10px";
        btn1.style.zIndex = "999999";
        btn1.style.padding = "8px 12px";
        btn1.style.background = "#1e90ff";
        btn1.style.color = "#fff";
        btn1.style.border = "none";
        btn1.style.borderRadius = "6px";
        btn1.style.cursor = "pointer";
        btn1.style.fontSize = "14px";
        btn1.style.boxShadow = "0 2px 6px rgba(0,0,0,0.3)";
        btn1.style.opacity = "0.85";
        btn1.style.transition = "opacity 0.2s";

        btn1.onmouseenter = () => btn1.style.opacity = "1";
        btn1.onmouseleave = () => btn1.style.opacity = "0.85";

        btn1.onclick = () => {
            const title = getProductTitle();
            if (!title) return alert("Product title not found on page.");
            const query = plusify(title);
            const url = `https://render-state.to/?s=${query}&post_type=post`;
            window.open(url, "_blank");
        };

        document.body.appendChild(btn1);


        // -----------------------------
        // Button 2: Search 3D‑Load
        // -----------------------------
        const btn2 = document.createElement("button");
        btn2.textContent = "Search 3D‑Load";
        btn2.style.position = "fixed";
        btn2.style.top = "50px"; // below the first button
        btn2.style.right = "10px";
        btn2.style.zIndex = "999999";
        btn2.style.padding = "8px 12px";
        btn2.style.background = "#28a745";
        btn2.style.color = "#fff";
        btn2.style.border = "none";
        btn2.style.borderRadius = "6px";
        btn2.style.cursor = "pointer";
        btn2.style.fontSize = "14px";
        btn2.style.boxShadow = "0 2px 6px rgba(0,0,0,0.3)";
        btn2.style.opacity = "0.85";
        btn2.style.transition = "opacity 0.2s";

        btn2.onmouseenter = () => btn2.style.opacity = "1";
        btn2.onmouseleave = () => btn2.style.opacity = "0.85";

        btn2.onclick = () => {
            const title = getProductTitle();
            if (!title) return alert("Product title not found on page.");
            const query = plusify(title);
            const url = `https://3d-load.net/?s=${query}&asp_active=1&p_asid=1&p_asp_data=1&filters_initial=1&filters_changed=0&qtranslate_lang=0&asp_highlight=1&current_page_id=169737`;
            window.open(url, "_blank");
        };

        document.body.appendChild(btn2);
    }


    // ----------------------------------------------------
    // reCAPTCHA Removal (site-wide)
    // ----------------------------------------------------
    function removeCaptcha() {
        const candidates = document.querySelectorAll("div[style*='z-index: 2000000000']");
        for (const el of candidates) {
            if (el.querySelector("iframe[src*='recaptcha']")) {
                el.remove();
                console.log("reCAPTCHA block removed.");
            }
        }
    }

    removeCaptcha();

    const observer = new MutationObserver(removeCaptcha);
    observer.observe(document.documentElement, { childList: true, subtree: true });

})();