Q:

Is there a way to know, if input value was changed by webpage or user?

So, is there a way to know, if input value was changed by webpage or user? For example, a input, I change its value with script help (GreaseMonkey), and I need to know if the value is changed/cleared by webpage or the user. This is what I have so far, will reset value, if there was any changes made.
if (firstInput.value != email) {
    firstInput.focus();
    firstInput.value = email;
}

A:

Not really, no. If you're in control of the page, you could make every change to the form fields through a wrapper function - and then check if the value is the same; if not, the user made a change.
Alternately, you could register for keystroke events, but this will not capture e.g. copying and pasting.

