Adds Throw at Neofriend action to inventory menu
当前为 
// ==UserScript==
// @name         GC - Throw Slorg at Neofriend Button
// @namespace    https://greasyfork.org/en/users/1251911
// @version      0.1
// @description  Adds Throw at Neofriend action to inventory menu
// @author       Teffy
// @match        https://www.grundos.cafe/inventory/
// @match        www.grundos.cafe/inventory/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=grundos.cafe
// @license      MIT
// @grant        none
// @downloadURL
// @updateURL
// ==/UserScript==
(function() {
    document.querySelectorAll('.inv-dropdown-menu').forEach(function(menu) {
        const pText = menu.querySelector('p').textContent.trim();
        if (pText === "Slorg") {
            const button = menu.querySelector('button[onclick]');
            const onclickAttr = button.getAttribute('onclick');
            const idMatch = onclickAttr.match(/['"]([a-f0-9\-]{36})['"]/);
            if (idMatch && idMatch[1]) {
                const id = idMatch[1];
                const throwButton = document.createElement('button');
                throwButton.setAttribute('onclick', `window.open('/useobject/${id}/?action=throw', 'newwindow', 'width=425,height=600'); return false;`);
                throwButton.innerHTML = `
                    <img src="https://grundoscafe.b-cdn.net/items/hall_petpet1.gif" alt="Throw Icon" class="dropdown-icon"> Throw at Neofriend
                `;
                menu.appendChild(throwButton);
            }
        }
    });
})();