Last active
June 18, 2020 16:32
-
-
Save iamandrewluca/19c7af78d28e0f92963130a71800c129 to your computer and use it in GitHub Desktop.
Toggle password inputs to text back and forth #bookmarklet
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
javascript: void ((function() { | |
/* More bookmarklets at https://gist.github.com/iamandrewluca/61feacf07bc4f2f50e70f986c2e9b2d2 */ | |
const passwordInputs = document.querySelectorAll('[type="password"], [data-password-bookmark-toggled]'); | |
Array.from(passwordInputs).forEach(e => { | |
if (e.getAttribute('data-password-bookmark-toggled')) { | |
e.removeAttribute('data-password-bookmark-toggled'); | |
e.setAttribute('type', 'password'); | |
} else { | |
e.setAttribute('data-password-bookmark-toggled', true); | |
e.setAttribute('type', 'text'); | |
} | |
}) | |
})()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment