Created
March 11, 2020 12:34
-
-
Save MarcelloTheArcane/5867ade3bfe2c0b9b3068f5a971d4f98 to your computer and use it in GitHub Desktop.
Autoapprove
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copy this into your console while on the 'Available' tab of https://my.ubtsupport.com/mobile_app_node.php | |
function tickThings () { | |
return Promise.all( | |
[...document.querySelectorAll('.actionAdd')] | |
.map(el => el.getAttribute('onclick').match(/appManagerStartApprovalFlow\((\d+)\)/)[1]) | |
.map(number => fetch('https://my.ubtsupport.com/asyncloader.php?async=1&load=mobileappplayapproval', { | |
credentials: 'include', | |
headers: { | |
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', | |
}, | |
body: `approvalurl=unmanaged&appid=${number}&autoassign=1`, | |
method: 'POST', | |
mode: 'cors', | |
}) | |
) | |
) | |
.then(() => appManagerSwitchTab('notapproved')) | |
} | |
var observer = new MutationObserver(function(mutations) { | |
mutations.forEach(function(mutationRecord) { | |
if (mutations[0].target.style.display === 'none') { | |
tickThings() | |
} | |
}) | |
}) | |
observer.observe(document.querySelector('.loadcover'), { | |
attributes: true, | |
attributeFilter: ['style'] | |
}) | |
tickThings() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment