igreg / AWS Web Console Service Shortkeys v2

// ==UserScript==
// @name         AWS Web Console Service Shortkeys v2
// @namespace    https://wiki.gslin.org/wiki/AWS_Web_Console_Service_Shortkeys
// @version      0.21
// @description  Use '/' and Escape to switch services in AWS Web Console
// @author       Gregory Becker
// @match        https://console.aws.amazon.com/*
// @match        https://*.console.aws.amazon.com/*
// @grant        none
// @license      MIT
// @grant GM_log
// ==/UserScript==

(function () {
  'use strict';

  document.addEventListener('keyup', function (event) {
    let aEl = document.activeElement;

    // '/' key in non-input field.
    if ('input' !== aEl.tagName.toLowerCase() && 'textarea' !== aEl.tagName.toLowerCase() && '/' === event.key) {
      document.getElementById('awsc-navigation-container').querySelectorAll("button[data-testid=aws-services-list-button]").item(0).click();
      return;
    }

    // Escape key in #awsc-services-search-autocomplete
    if ('awsc-services-search-autocomplete' === aEl.id && 'Escape' === event.key) {
      document.getElementById('awsc-navigation-container').querySelectorAll("button[data-testid=aws-services-list-button]").item(0).click();
      return;
    }
  });
})();