Created
July 24, 2014 14:36
-
-
Save genecyber/a3f90f2f8891ac794fff to your computer and use it in GitHub Desktop.
Bookmarklet to easily add n characters to every input field on a page
This file contains hidden or 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: (function() { | |
var count = prompt("Enter the number of random characters to add to found inputs.", "1000000"); | |
jscript = document.createElement("script"); | |
jscript.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"; | |
jscript.onload = jscript.onreadystatechange = function() {}; | |
document.body.appendChild(jscript); | |
$.noConflict(); | |
jQuery.noConflict(); | |
jQuery.each(jQuery("input"), function() { | |
var name = this.attributes; | |
if (name.getNamedItem("type").value != "hidden" && name.getNamedItem("type").value != "submit" && name.getNamedItem("type").value != "checkbox" && name.getNamedItem("type").value != "file") { | |
var text = ""; | |
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
for (var i = 0; i < count; i++) text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
jQuery(this).val(text); | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment