// ==UserScript== // @name Convidador de casamentos // @namespace Violentmonkey Scripts // @description Convida todo mundo da lista de relacionamentos // @include https://*.popmundo.com/World/Popmundo.aspx/Locale/MarriagePartners* // @grant none // @license MIT // @version 1.9 // @author - // @description Atualizado para aguardar o botão de convite dinamicamente // @downloadURL https://update.greasyfork.icu/scripts/524759/Convidador%20de%20casamentos.user.js // @updateURL https://update.greasyfork.icu/scripts/524759/Convidador%20de%20casamentos.meta.js // ==/UserScript== (function () { function AwaitIframeLoad(iframe) { return new Promise((resolve) => { iframe.on('load', function () { resolve(iframe.contents()); }); }); } async function waitForInviteButton(iframe, id) { return new Promise((resolve) => { const interval = setInterval(async () => { const newContents = iframe.contents(); const inviteButton = newContents.find(`#ctl00_cphLeftColumn_ctl00_repDetailsFindGuest_ctl01_btnInvite`); if (inviteButton.length > 0) { const buttonElement = iframe[0].contentDocument.getElementById( "ctl00_cphLeftColumn_ctl00_repDetailsFindGuest_ctl01_btnInvite" ); if (buttonElement) { clearInterval(interval); resolve(); } } }, 1000); }); } if (typeof jQuery === 'undefined') { return; } if (window.self !== window.top) { return; } function checkForTargetDiv() { const targetDiv = jQuery('.ofauto.bmargin10'); if (targetDiv.length > 0) { addCustomUI(targetDiv); return true; } else { return false; } } function addCustomUI(targetDiv) { const newDiv = jQuery(`