John Mathews
John Mathews

Reputation: 231

Is it possible for a website to know if you edit their javascript variables?

So I am forced to complete an online course for my school that uses javascript functions to ensure each student stays on the page for at least a "required_variable" amount of time. Now using the javascript console I am able to just reset the required_variable amount of time to 0, thus allowing me to go to the next page without waiting their amount of time. So my question is whether the website could possibly know that I am resetting their variable. I looked at their code, and I seriously doubt that this particular website can, but I am more wondering because I design websites and there are certain javascript variables I wouldn't want to be overridden in some of my websites.

Upvotes: 7

Views: 136

Answers (2)

Marcel Stör
Marcel Stör

Reputation: 23555

whether the website could possibly know that I am resetting their variable

Yes, there's Object.watch() from Mozilla and generic implementations for all browsers (e.g. Listening for variable changes in JavaScript or jQuery - a number of examples there).

In such a case the "watch function" could for example call back to the server to notify.

Upvotes: 5

FelipeAls
FelipeAls

Reputation: 22171

The exact time you clicked on the Next/Answer button could be recorded server side; the exact time your browser requested each page is logged by the server along with your IP so it'll always be possible to analyse your behaviour for the past year. Though it's unclear why or if they would do that.

Risk analysis: what would you gain from doing what you intend to do? What would you risk? If it seems dumb to you (I don't know, you gave little details... with reasons :) ), it may be super mega important to them to enforce this rule... and be mad at you.
tl;dr don't

Upvotes: 2

Related Questions