问题
There is a certain website with a certain login form which includes two fields; username and password.
I can successfully inject data with vanilla JavaScript to the first field:
document.querySelector("#username").value = "USERNAME";
But when I try to inject a password:
document.querySelector("#password").value = "PASSWORD";
I get an error:
VM1766:1 Uncaught TypeError: Cannot set property 'value' of null at :1:45
My problem
I double checked if the field exists as is and it is indeed existing in DOM;
I further ran a code like console.log(document.querySelector("#password"));
and got lots of output which I purposely evade pasting here due to legal reasons.
My question
What kind of JavaScript protection is usually applied on fields to prevent value injection?
来源:https://stackoverflow.com/questions/60293387/what-kind-of-javascript-protection-is-usually-applied-on-fields-to-prevent-value