Skip to content

Instantly share code, notes, and snippets.

@hjdarnel
Created March 12, 2024 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hjdarnel/d014de4c9f9361ac656a441525f6b503 to your computer and use it in GitHub Desktop.
Save hjdarnel/d014de4c9f9361ac656a441525f6b503 to your computer and use it in GitHub Desktop.
GreaseMonkey/TamperMonkey script to put input focus on the Confirm/continue button for AWS CLI SSO login
// ==UserScript==
// @name AWS SSO Focus Confirm and Continue button
// @version 1.0.1
// @description Focus authorize allow button when confirming AWS CLI SSO code
// @downloadURL https://gist.github.com/hjdarnel/d014de4c9f9361ac656a441525f6b503/raw/focus-aws-sso-code-confirm-allow.user.js
// @updateURL https://gist.github.com/hjdarnel/d014de4c9f9361ac656a441525f6b503/raw/focus-aws-sso-code-confirm-allow.user.js
// @author Henry Darnell @hjdarnel
// @match https://device.sso.us-east-1.amazonaws.com/*
// @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_verification_btn");
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