I created a bookmark on my Chrome browser with the following javascript code. So I don't need to type username/password for the login web pages.
javascript:(()=>{
let f=(s,v)=>document.querySelector(`[id$="${s}"],[name$="${s}"],[type$="${s}"]`).value=v;
f('password','....');
f('username','...')
})()
It works on most of our login pages. However, on one of the login pages created with React, the username and password text boxes (html input) do fill in, but the value is not submitted when clicking the login button. Unless I make some editing in the username and password text box (e.g., by adding a space and then delete it).
Is it a way to avoid manually editing the text boxes? (it seems the script needs to trigger some events like keyup?)
HTML input:
<input autocomplete="off" id="username" disabled="" class="login-input input" type="text" value="">
Tried the following code and it still behaves the same.
javascript:(()=>{
let f=(s,v)=>{
x=document.querySelector([id$="${s}"],[name$="${s}"],[type$="${s}"]);
x.value=v;
x.dispatchEvent(new Event("change", {target: {value: v}}))
};
f('password','....');f('username','....')
})()
