Forked from gregory-seidman/aws_close_sso_success.user.js
Last active
March 19, 2024 15:46
-
-
Save hjdarnel/6163bafb3595d3fd7a0b6e42e4db0248 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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