Question

Is it possible to detect if - let's say - someone uses firebug to change parts of the website that's been loaded.

E.g. I got <a href="javascript:myfunc('hello')"> and someone changes that to <a href="javascript:myfunc('NOThello')">. Can I immediately detect this change somehow?

Thank you.

Was it helpful?

Solution 2

Ah, right, you're just curious about how to do that!

I can't reproduce your test case, but here are the options I see:

  • using a recursive setTimeout or setInterval checking when the element has been altered, but that is highly slow and ugly
  • using mutation observers, and unset the changes

Florent

OTHER TIPS

No, you cannot.

You could obviously write code to check to see if something was the way you wanted it to be, but guess what? People could change that very code to bypass the detection. Web pages are complete insecure. You cannot trust anything in them. They can be easily altered - any part of them can be altered including HTML, javascript, etc... And, using debuggers is not the only way to alter web pages - there are many different techniques including things like active proxies.

You MUST verify and check on the server anything that is being submitted to a server because you simply cannot trust its origin. For example, people use client-side javascript to validate data that is entered into forms all the time, but this is ONLY done to improve the user experience if something is entered incorrectly (so you can more easily tell the user something is wrong BEFORE the data is submitted to the server). All validation checking must also be done on the server to make sure that only valid data gets into your server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top