As of August 2023, the bug seems to have now been fixed, making the method in this guide for automatically logging in obsolete. This guide will remain archived. The original title of this thread was "Instructions on how to automatically login to duelingbook without having to manually type your username and password".
Currently on duelingbook, when you want to login, you have to manually type your username and password in these little white boxes each time.
This can be a very tedious process, especially if you have a long/complex username/password that uses a combination of letters, numbers, and symbols, or if you're just trying to quickly log back in after being disconnected or timed out.
Fortunately, thanks to javascript, I can now make it so that instead of manually typing in my username and password each time, I can login to my account with just the click of a button, or in this case, the click of a javascript bookmark.
You do need to make sure javascript is enabled and allowed on your browser and on duelingbook, and make sure you refresh/reload the page if necessary.
Here is the javascript code for the bookmark will allow you to login to duelingbook without having to manually type in your username and password.Code: Select all
javascript:var YourUsername = "InsertYourUsernameHere";
var YourPassword = "InsertYourPasswordHere";
function performLogin() {
if (logging_in) {
return;
}
logging_in = true;
var fd = new FormData();
fd.append("username", YourUsername);
fd.append("password", YourPassword);
fd.append("remember_me", ~~false);
fd.append("db_id", db_id);
fd.append("session", session_id);
fd.append("browser", getBrowser());
var xhr = new XMLHttpRequest();
xhr.open("POST", URL_START + "php-scripts/login-user.php", true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
performLoginResponse(xhr.responseText);
}
}
;xhr.onerror = ioError;
xhr.send(fd);
showDim();
}
performLogin();
To make this code work, we need to copy and paste it onto something like notepad, where we can easily edit it.
At the very top where it says InsertYourUsernameHere, we're going to replace that with whatever our username is. Since my username is Christen57, I'm going to replace InsertYourUsernameHere with Christen57.
Right below that, where is says InsertYourPasswordHere, we're going to replace that with whatever our password is. For this demonstration, I'm going to pretend our password is abcd1234.
After we replace InsertYourUsernameHere with our username and replace InsertYourPasswordHere with our password, we're going select everything and copy it, or if we're on windows 10, we can instead input CTRL+A then CTRL+C on our keyboard to select everything and copy it automatically.
After that, we're going to create a new javascript bookmark, name it whatever we want (I will be naming mine "auto login"), then in the URL, Address, or Location box, whatever the browser calls it, we will paste our copied code that had our username and password. After that, we will save our bookmark.
We will go to duelingbook, and then instead of manually typing our username and password in the boxes, we will click our newly created bookmark. If both the username as password are correct, duelingbook will accept them and log us in automatically.
As you can see, duelingbook rejects the fake password abcd1234 because it requires the actual password for the account in order for the automatic login to be successful, so you must must use your actual username and password for logging in, not the username and password I used for this demonstration, but it does work when both the username and password are correct, and I've tested it on Vivaldi, Google Chrome, and Firefox.