// ==UserScript== // @name MouseHunt - Gifting Buttons // @author Tran Situ (tsitu) // @namespace https://greasyfork.org/en/users/232363-tsitu // @version 1.2 // @description Adds buttons to easily ignore/accept/return all gifts // @match http://www.mousehuntgame.com/* // @match https://www.mousehuntgame.com/* // @downloadURL none // ==/UserScript== (function() { const observerTarget = document.querySelector("#overlayPopup"); if (observerTarget) { MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; const observer = new MutationObserver(function() { // Callback const claimableExists = document.querySelector( ".giftSelectorView-tabContent.selectClaimableGift" ); if (claimableExists) { // Render buttons if 'Claim Free Gifts' dialog is in DOM buildUI(); } }); // Observe mutations in