Skip to content

Instantly share code, notes, and snippets.

@warrenseine
Last active January 24, 2023 12:40
Show Gist options
  • Save warrenseine/ea6809ee6fc5c31568485f1a0fcbc3a7 to your computer and use it in GitHub Desktop.
Save warrenseine/ea6809ee6fc5c31568485f1a0fcbc3a7 to your computer and use it in GitHub Desktop.
Tampermonkey AWS VPN Auto-Close
// ==UserScript==
// @name AWS VPN Auto-Close
// @namespace http://tampermonkey.net/
// @match http://127.0.0.1/
// @grant window.close
// @version 1.0
// @author Warren Seine
// @description Close the tab when successful AWS VPN is on
// @icon https://a0.awsstatic.com/libra-css/images/site/fav/favicon.ico
// ==/UserScript==
setInterval(() => {
if (document.querySelector("text")?.innerText?.includes("Authentication details received")) {
window.close()
}
}, 100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment