[DEPRECATED] AWS Web Console Service Shortkeys

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

目前为 2020-12-13 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name [DEPRECATED] AWS Web Console Service Shortkeys
  3. // @namespace https://wiki.gslin.org/wiki/AWS_Web_Console_Service_Shortkeys
  4. // @version 0.20201213.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. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. document.addEventListener('keyup', function(event) {
  17. let aEl = document.activeElement;
  18.  
  19. // '/' key in non-input field.
  20. if ('input' !== aEl.tagName.toLowerCase() && 'textarea' !== aEl.tagName.toLowerCase() && '/' === event.key) {
  21. document.getElementById('search-box-input').focus();
  22. return;
  23. }
  24. });
  25. })();