Last active
March 10, 2017 13:37
-
-
Save zanbaldwin/ab974fc54016a43705fa3b469e902d47 to your computer and use it in GitHub Desktop.
Insert a test email address into the active DOM element. Update with your email user and domain. Save to your bookmarks bar.
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:for(var n=new Date,m="Seconds Minutes Hours Date Month FullYear".split(" "),s="",i=m.length,a=document.activeElement;i;i--)f=n["get"+m[i-1]](),s+=10>f?"0"+f:f;if(a.isContentEditable||["input","textarea"].indexOf(a.tagName.toLowerCase())>-1)a.value="email.user+"+s+"@domain.tld"; |
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
(function(user, domain) { | |
var now = new Date(), | |
methods = ['getFullYear', 'getMonth', 'getDate', 'getHours', 'getMinutes', 'getSeconds'].reverse(), | |
string = '', | |
field; | |
for (var i = methods.length; i; i--) { | |
field = now[methods[i - 1]](); | |
string += field < 10 ? '0' + field : field; | |
} | |
if (document.activeElement.isContentEditable | |
|| ['input', 'textarea'].indexOf(document.activeElement.tagName.toLowerCase()) > -1 | |
) { | |
document.activeElement.value = user + '+' + string + '@' + domain; | |
} | |
})('email.user', 'domain.tld'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment