3

Currently I have a page that I visit often, and a javascript: bookmarklet that I also use every time I visit the page. For example:

javascript:(function(){getElementByName("profile-name").value="Maurdekye";})()

And every time I click my bookmark to go to this page, I also click this bookmarklet to automatically fill out this information. I'd like to know if it's possible to have both of these actions in a single bookmark. I tried setting the location.href property to redirect to the webpage, and putting the above function in document.onload. It redirects when I click the bookmark, but it doesn't run the code. This is what I have tried so far;

javascript:(function(){location.href="https://my.website.net/login.html";document.onload=(function(){getElementByName("profile-name").value="Maurdekye";});})()
Maurdekye
  • 3,597
  • 5
  • 26
  • 43
  • Not possible through a bookmarklet. You'd need to build an extension or a greasemonkey/tampermonkey userscript. – nderscore Jan 19 '16 at 16:54

0 Answers0