Last active
December 2, 2021 15:48
-
-
Save rickythefox/8c6ff909a5c759d3ad3faf970766561f to your computer and use it in GitHub Desktop.
Clean up long and ugly SSO username in AWS console
This file contains hidden or 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
// ==UserScript== | |
// @name Cleanup AWS SSO username | |
// @namespace http://tampermonkey.net/ | |
// @version 1.1 | |
// @description Fix long and ugly SSO username | |
// @author Richard Ginzburg | |
// @match https://*.console.aws.amazon.com/* | |
// @grant none | |
// @run-at document-end | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const spans = document.getElementsByTagName('span') | |
const foundSpans = [] | |
for (const s of spans) { | |
if (s.childElementCount === 0 && s.innerText && s.innerText.startsWith('AWSReservedSSO_')) { | |
foundSpans.push(s) | |
if (foundSpans.length === 2) | |
break | |
} | |
} | |
foundSpans[0].innerText = foundSpans[1].innerText.split('/')[1] | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment