Created
August 11, 2022 17:02
-
-
Save mlr/822c02d3d2bd83dfee11e20c75f376bc to your computer and use it in GitHub Desktop.
Starter form fill 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: | |
var formFill = function($) { | |
// Fill the form fields here | |
// $('#myField').val('Hello world'); | |
}; | |
(function(e, s) { | |
if(typeof jQuery != 'undefined') { | |
console.log('jQuery already loaded'); | |
formFill(jQuery); | |
return; | |
} | |
e.src = s; | |
e.onload = function() { | |
jQuery.noConflict(); | |
console.log('jQuery injected'); | |
formFill(jQuery); | |
}; | |
document.head.appendChild(e); | |
})(document.createElement('script'), '//code.jquery.com/jquery-latest.min.js'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment