Would you prefer to have your coin address prefilled on faucet claim & login pages?
If you love faucets you probably don't love those like *coinfaucet.info that forget your coin address every time you make a claim, requiring you to enter it over and over. This is annoying, and unneccessary.
What if I told you that you could use JavaScript to do this for you automagically?
I'm going to show you how.
Caveat: this technique requires the use of a browser extension, if you're against such things for any reason then read no further. Recording your cryptocurrency public key (receiving address) in an automation script is perfectly safe because it's public & already in the public domain but you should NEVER record a private key, username, or password in this manner, such information is too private and powerful.
Prerequisite: Install Browser Extension
To run the Javascript a Google Chrome extension called Tampermonkey is required, grab that now:
Tampermonkey: https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo
1. Setup Faucet Page Script
Go to a *coinfaucet.info faucet page, we will use the Litecoin faucet page as an example to follow, here's my referral link: litecoinfaucet.info
Click the Tampermonkey extension in your browser toolbar and choose "Create a new script..."
A new blank script is displayed, note the @match value is already set to the current URL...
Copy and paste this codeblock to replace the contents:
// ==UserScript==
// @name LTC.info address prefill
// @namespace unoriginal-but-unique
// @version 0.1
// @description to the moon, automagically!
// @author You
// @match http://litecoinfaucet.info/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
if (document.readyState == "complete" || document.readyState == "loaded" || document.readyState == "interactive") {
document.getElementById("address").value = "neuromancer";
} else {
document.addEventListener("DOMContentLoaded", function(event) {
document.getElementById("address").value = "neuromancer";
});
}
})();
Note that we add /* to the end of the URL to ensure the script matches subpages as well
Tailor the script: replace neuromancer (keep the quotes) with your coin receiving address & click save
Refresh the faucet page to see the results
Tampermonkey now displays a red box with a "1" in it, indicating it's running 1 script on the current page.
2 Reusing the script
The script can be reused on other *coinfaucet.info pages if you tailor it to accordingly. Below is the functional part of the code, just copy & paste it into each newly created script where it says // Your code here...:
if (document.readyState == "complete" || document.readyState == "loaded" || document.readyState == "interactive") {
document.getElementById("address").value = "neuromancer";
} else {
document.addEventListener("DOMContentLoaded", function(event) {
document.getElementById("address").value = "neuromancer";
});
}
Then tailor each new script to your needs by changing these 4 values (highlighted in the image above):
: a name for saving the script, unique to each version, eg:
LTC.info address prefill,RDD.info address prefill, etc: a unique namespace the script runs under, can be anything and can be reused so long as it's unique to prevent conflict with other scripts that may be running on the page
: the page the script targets, it's pre-set during script creation at each site but you should append it with /*
- neuromancer: me, just kidding, replace my name with your coin receiving address
Here are some more *coinfaucet.info referral links for you:
reddcoinfaucet.info
ethereumfaucet.info
dashfaucet.net
ripplefaucet.info
decredfaucet.info
The script can also be tailored for other faucet pages, here's a version modified to prefill Moon faucet login pages, just remember to tailor each new script with your 4 values:
// ==/UserScript==
(function() {
'use strict';
if (document.readyState == "complete" || document.readyState == "loaded" || document.readyState == "interactive") {
document.getElementById("BodyPlaceholder_PaymentAddressTextbox").value = "neuromancer";
} else {
document.addEventListener("DOMContentLoaded", function(event) {
document.getElementById("BodyPlaceholder_PaymentAddressTextbox").value = "neuromancer";
});
}
})();
And here's some Moon faucet referral links:
moonbit.co.in
moonliteco.in
moondoge.co.in
Now head back to those faucets and STEEM ON!
This article is provided as-is for informational purposes only, I neither condone or condemn the use of faucets, browser plugins/extensions, or JavaScript.
Questions and comments are welcomed in the replies. If you'd like to see more articles like this then ^vote and resteem. Considerable effort has gone into researching, testing, graphics capture/edit, and formatting for this article.