Skip to content

Instantly share code, notes, and snippets.

@dennisstewart
Last active January 27, 2023 22:44
Show Gist options
  • Save dennisstewart/ae54133e46755acd4e6a6cdb83809c9f to your computer and use it in GitHub Desktop.
Save dennisstewart/ae54133e46755acd4e6a6cdb83809c9f to your computer and use it in GitHub Desktop.
Re-enables the password box on TreasuryDirect.gov so I can paste from my password manager
// ==UserScript==
// @name TreasuryDirect Copypasta
// @version 0.2
// @description Allow creds to be pasted from a password manager into the TreasuryDirect login form.
// @author Dennis Stewart
// @license The Strong Style Public License https://raw.githubusercontent.com/dennisstewart/cvs-checker-py/main/LICENSE
// @match https://*.treasurydirect.gov/RS/PW-Display.do*
// @icon https://www.google.com/s2/favicons?sz=64&domain=treasurydirect.gov
// @grant none
// ==/UserScript==
(function() {
'use strict';
document.querySelector("input[class='pwordinput']").removeAttribute("readonly");
document.querySelector(".pwordinput").setAttribute("style", "background-color: initial !important");
//thanks Jan Biniok(Tampermonkey dev) and Büchner Matthias (tutorial video maker - https://www.youtube.com/watch?v=hAeWOOJPp0o)
})();
@alanhoyle
Copy link

The TreasuryDirect login page has removed the "www." and changed to:

https://treasurydirect.gov/RS/PW-Display.do

@jhristu
Copy link

jhristu commented Nov 2, 2022

The TreasuryDirect login page has removed the "www." and changed to:

https://treasurydirect.gov/RS/PW-Display.do

Just update the @match part to make it work again, e.g.

// @match        https://*.treasurydirect.gov/RS/PW-Display.do

@dennisstewart
Copy link
Author

Thanks @alanhoyle and @jhristu.
I've updated it to a more permissive match string (works regardless of subdomain or query strings, such as errors).
Also now changes the password text box's background color into whatever color is the user's default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment