Bookmarklets — quick and dirty way to run JS on a webpage
1 min readSep 27, 2019
TL:DR use https://bookmarkify.it/ to automate tiny tasks in your web browser
When I was working on a feature that meant I had to place a lot of test orders and found typing in the credit card details every time very tedious.
Below you can see the form filling up with details when I click the bookmarklet.
How to make one
- First write the javascript
Go into the console of your favourite browser (Chrome , Firefox) and write the code that’ll make what you want to happen happen. In the above case it looks like this.
document.getElementById('card_number').value = '4242424242424242';
document.getElementById('card_name').value = 'fake person';
document.getElementById('cvc-field').value = '123';
document.getElementById('card_expiry_month').value = '1';
document.getElementById('card_expiry_year').value = '2022';
document.getElementById('order_terms_of_service').checked = true;
2. Go to https://bookmarkify.it/ and copy and paste your javascript in. They’ll give you a link you can drag directly into your browser and you’re done!