Last active
April 1, 2023 07:56
-
-
Save projected1/e8a5ac0ba282619488deaf86ec256f4a to your computer and use it in GitHub Desktop.
Abbreviates service names in AWS favorites toolbar.
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 AWS Favorites Abbreviator | |
// @namespace https://gist.github.com/projected1 | |
// @version 0.2 | |
// @description Abbreviates service names in AWS favorites toolbar | |
// @author Daniel Gorbatov | |
// @license MIT | |
// @homepage https://gist.github.com/projected1/e8a5ac0ba282619488deaf86ec256f4a | |
// @match https://*.aws.amazon.com/* | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
const abbr = { | |
'Amazon EventBridge': 'EB', | |
'API Gateway': 'APIG', | |
'AWS Organizations': 'Org', | |
'CloudFormation': 'CFN', | |
'CloudFront': 'CF', | |
'CloudTrail': 'CT', | |
'CloudWatch': 'CW', | |
'Detective': '🕵️♂️', | |
'DynamoDB': 'DDB', | |
'EC2': 'EC2', | |
'Elastic Container Service': 'ECS', | |
'GuardDuty': 'GD', | |
'IAM': 'IAM', | |
'Lambda': 'λ', | |
'Resource Groups & Tag Editor': 'Rsrc', | |
'Route 53': '53', | |
'S3': 'S3', | |
'Simple Notification Service': 'SNS', | |
'Simple Queue Service': 'SQS', | |
'Trusted Advisor': 'TA', | |
'Step Functions': 'SFN', | |
'WAF & Shield': 'WAF', | |
}; | |
const handle = setInterval(() => { | |
const elements = document.querySelectorAll('header ol li a span'); | |
if (elements.length) { | |
clearInterval(handle); | |
elements.forEach(el => (el.innerHTML = abbr[el.innerHTML] ?? el.innerHTML)); | |
} | |
}, 100) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment