I have a javascript like this, used i a bookmarklet:
window.location="URL"
document.getElementById('username-id').value = 'User'
document.getElementById('pwd-id').value = 'pass'
doLogin();
The problem is that javascript stops as soon as it hits the URL. How to make it go to a page and execute a script?
Any help would be greatly appreciated.
I don't recommend browser extensions - they allow untrusted code to run in the context of trusted code. If you have a browser extension that loads a page and automatically enters your userID and password, what stops it from posting those credentials to a malicious site? Only you, and only if you've carefully read the source code.
To solve the problem above I've added bookmarklets to the favorites bar in my browser that require two clicks: 1. Click to navigate to the location 2. Click to fill the form
javascript:
var L='http://mysite.com/';
if(location!=L)location=L;
else{
document.getElementById('username-id').value='User';
document.getElementById('pwd-id').value = 'pass';
document.close();
doLogin();
}
Good Luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With