Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hjdarnel/6163bafb3595d3fd7a0b6e42e4db0248 to your computer and use it in GitHub Desktop.
Save hjdarnel/6163bafb3595d3fd7a0b6e42e4db0248 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name AWS Close SSO success
// @version 1.0.7
// @description Close the tab after successfully logging in via SSO
// @downloadURL https://gist.github.com/hjdarnel/6163bafb3595d3fd7a0b6e42e4db0248/raw/aws_close_sso_success.user.js
// @updateURL https://gist.github.com/hjdarnel/6163bafb3595d3fd7a0b6e42e4db0248/raw/aws_close_sso_success.user.js
// @author Gregory Seidman @gregory-seidman
// @match https://*.awsapps.com/start/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=awsapps.com
// @grant window.close
// ==/UserScript==
(function () {
"use strict";
var func;
func = function () {
const success = document.querySelector(
"div[data-analytics-alert='success']"
);
if (success) {
window.close();
} else {
setTimeout(func, 300);
}
};
func();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment