Skip to content

Instantly share code, notes, and snippets.

@MarcelloTheArcane
Created March 11, 2020 12:34
Show Gist options
  • Save MarcelloTheArcane/5867ade3bfe2c0b9b3068f5a971d4f98 to your computer and use it in GitHub Desktop.
Save MarcelloTheArcane/5867ade3bfe2c0b9b3068f5a971d4f98 to your computer and use it in GitHub Desktop.
Autoapprove
// 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