Created
August 4, 2020 09:52
-
-
Save danmilleruk/22f639cc3e1378661d1765cc4da00f52 to your computer and use it in GitHub Desktop.
Tampermonkey script to add a search box to the AWS SAML login screen
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 Shib SSO Search | |
// @namespace signin.aws.amazon.com | |
// @description Provides SAML search functionality | |
// @include https://signin.aws.amazon.com/saml | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
$('fieldset').before('<div id="searchbox"><input type="text" placeholder="Account Search..."></div>'); | |
$('#searchbox > input').css('width', '100%'); | |
$('#searchbox > input').css('margin', '10px'); | |
$('#searchbox > input').css('border-radius', '15px'); | |
$('#searchbox > input').css('padding', '10px'); | |
$('#searchbox > input').css('border', '1px #CCC solid'); | |
$('#searchbox > input').focus(); | |
$('#searchbox > input').keyup(function(){ | |
if ($(this).val() == '') { | |
$('fieldset > div.saml-account').show(); | |
} else { | |
var keyword = $(this).val(); | |
$('fieldset > div.saml-account').each(function(){ | |
var accountName = $(this).find('.saml-account-name').text(); | |
if (accountName.indexOf(keyword) == -1) { | |
$(this).hide(); | |
} else { | |
$(this).show(); | |
} | |
}) | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment