Modify AWS console service names

Modify the AWS service names to not include "Amazon" or "AWS"

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Modify AWS console service names
// @namespace    https://greasyfork.org/en/users/321441-david-cuthbert
// @version      0.2
// @description  Modify the AWS service names to not include "Amazon" or "AWS"
// @author       David Cuthbert ([email protected])
// @match        https://*.console.aws.amazon.com/*
// @grant        none
// @run-at       document-body
// @require      http://code.jquery.com/jquery-3.4.1.slim.min.js
// @license      Apache-2.0
// ==/UserScript==

/* global jQuery */

(function() {
    'use strict';
    let mezz_data = jQuery("meta[name='awsc-mezz-data']");
    if (! mezz_data) {
        console.log("meta tag with name=\"awsc-mezz-data\" not found");
        return;
    }

    let content = JSON.parse(mezz_data.attr("content"));
    for (let service of content.services) {
        if (! service.label) { continue; }
        if (service.label.startsWith("AWS ")) {
            service.label = service.label.substring(4);
        } else if (service.label.startsWith("Amazon ")) {
            service.label = service.label.substring(7);
        }
    }

    mezz_data.attr("content", JSON.stringify(content));
})();