// ==UserScript== // @name 🐭️ Mousehunt - Item Quantity Fix // @version 1.0.1 // @description Fixes the "You Own: 0" bug when viewing an item info page. // @license MIT // @author bradp // @namespace bradp // @match https://www.mousehuntgame.com/i.php // @icon https://brrad.com/mouse.png // @grant none // @downloadURL none // ==/UserScript== /** * On load check for the item quantity and url param. */ $(document).ready(function () { // eslint-disable-line no-undef const urlParam = 'i.php?id='; if (window.location.href.indexOf(urlParam) === -1) { return; } const id = window.location.href.split(urlParam)[1]; const qty = document.querySelector('.itemView-sidebar-quantity'); if (! (qty && qty.textContent.indexOf('You Own:') !== -1)) { return; } const itemName = document.querySelector('.itemViewContainer').getAttribute('data-item-type'); if (!itemName) { return; } hg.views.ItemView.show(itemName); });