I am making a selenium bot for discord. I dont want to log in using username and password. Theres a way to login using your account token. I have the token but to proceed to you need to execute these in the Chrome Developer Tools Console
function login(token) {
setInterval(() => {
document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"${token}"`
}, 50);
setTimeout(() => {
location.reload();
}, 2500);
}
login('PASTE TOKEN HERE')
I want to know how can I execute this code from Selenium (JAVA)