Skip to content

Instantly share code, notes, and snippets.

@gregory-seidman
Last active March 11, 2024 21:28
Show Gist options
  • Save gregory-seidman/33a2f4174871bc42966f34e1e7c4ec01 to your computer and use it in GitHub Desktop.
Save gregory-seidman/33a2f4174871bc42966f34e1e7c4ec01 to your computer and use it in GitHub Desktop.
GreaseMonkey/TamperMonkey script to put input focus on the Allow button for AWS CLI SSO login
// ==UserScript==
// @name AWS SSO Focus Allow button
// @namespace https://gist.github.com/gregory-seidman/dd8b7a93f4603ef3e484c82d45809a95
// @version 1.0.4
// @description Focus authorize allow button when confirming AWS CLI SSO login
// @downloadURL https://gist.github.com/gregory-seidman/33a2f4174871bc42966f34e1e7c4ec01/raw/focus-aws-sso-authorize-allow.user.js
// @updateURL https://gist.github.com/gregory-seidman/33a2f4174871bc42966f34e1e7c4ec01/raw/focus-aws-sso-authorize-allow.user.js
// @author Gregory Seidman
// @match https://*.awsapps.com/start/user-consent/authorize.html?*
// @icon https://www.google.com/s2/favicons?domain=awsapps.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
var func;
func = function() {
const btn = document.getElementById("cli_login_button");
if (btn) {
btn.focus();
} else {
setTimeout(func, 300);
}
}
func();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment