Wednesday, October 9, 2024

Automate Form Submissions using Bookmarklets

Automate Form Submissions using Bookmarklets

I recently learned of a technically inclined user who wrote “macros” to streamline data entry into a complex enterprise Web application. My initial reaction was: “There are no macros in Internet Explorer so how did he hook into the page?” It turned out that he was using something called a Bookmarklet. I don’t know how I managed to never hear about them for all these years, but I could immediately envision a myriad of uses for them. In today’s article, I’ll explain what they are, how they work, and how to use them to automatically fill out and submit a form one time or a thousand times over!

What is a Bookmarklet?

Let’s start with what a bookmark is. It’s just a link to a Web resource that usually begins with the “http:”, “file:”, or “ftp:” protocol. There is another special prefix that browsers recognize: “javascript:”. It tells the browser to execute everything that comes after as JavaScript code. You can try it yourself in a hyperlink like so:

<a href="javascript: alert('Howdy ho!');">Try this out!</a>

bookmarklet_creation_in_chrome.jpg

Rob Gravelle
Rob Gravelle
Rob Gravelle resides in Ottawa, Canada, and has been an IT guru for over 20 years. In that time, Rob has built systems for intelligence-related organizations such as Canada Border Services and various commercial businesses. In his spare time, Rob has become an accomplished music artist with several CDs and digital releases to his credit.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Popular Articles

Featured