AWS Web Console Service Shortkeys

Use '/' and Escape to switch services in AWS Web Console

目前為 2019-09-23 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name AWS Web Console Service Shortkeys
  3. // @namespace https://wiki.gslin.org/wiki/AWS_Web_Console_Service_Shortkeys
  4. // @version 0.20190924.0
  5. // @description Use '/' and Escape to switch services in AWS Web Console
  6. // @author You
  7. // @match https://console.aws.amazon.com/*
  8. // @match https://*.console.aws.amazon.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. document.addEventListener('keyup', function(event) {
  16. // '/' key in non-input field.
  17. if ('input' !== document.activeElement.tagName.toLowerCase() && '/' !== event.key) {
  18. document.getElementById('nav-servicesMenu').click();
  19. return;
  20. }
  21.  
  22. // Escape key in #awsc-services-search-autocomplete
  23. if ('awsc-services-search-autocomplete' === document.activeElement.id && 'Escape' === event.key) {
  24. document.getElementById('nav-servicesMenu').click();
  25. return;
  26. }
  27. });
  28. })();