AWS-SSO-Console-User-Title-Fix

With AWS SSO the AWS Console Title is ridiculously long, this aims to shorten and list the account name

目前为 2021-08-10 提交的版本。查看 最新版本

// ==UserScript==
// @name         AWS-SSO-Console-User-Title-Fix
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  With AWS SSO the AWS Console Title is ridiculously long, this aims to shorten and list the account name
// @author       John Polansky
// @icon         https://www.google.com/s2/favicons?domain=userscript.zone
// @include      https://console.aws.amazon.*
// @include      https://*.console.aws.amazon.*
// @run-at       document-end
// @inject-into content
// @license      MIT
// @noframes
// @grant window.close
// @grant window.focus
// ==/UserScript==

(function() {
    'use strict';
    // The ClassName might change with updates, find the title in inspect and replace it here
    let str = document.getElementsByClassName("ThRjn7o-KwO0459UzmvoU")[0].title
    let re = /\w+_(\w+)_(\w+)\/(.*)\s+@\s+(.+)/
    let results = re.exec(str)
    let role = results[1]
    let username = results[3].replace(/@.*$/, "")
    let account = results[4]
    document.getElementsByClassName("ThRjn7o-KwO0459UzmvoU")[0].innerHTML = `${account} / ${role} / ${username}`
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址