comnetsAD / JS_Analyzer

A JavaScript cleaning tool.
5 stars 2 forks source link

Highlight elements affected by script #6

Open J16053 opened 5 years ago

J16053 commented 5 years ago

In addition to printing script contents to the console when they are selected, see if selenium can be used to highlight HTML elements accessed by the script for better visualization of what each script does.

J16053 commented 5 years ago

Extensive tracing of JavaScript variables would be needed in order to implement this properly, but local variables in functions aren't accessible from the browser so this may be quite tough. Perhaps we can try and find an alternative - reconsider the screenshot-comparing method?

HaseebLUMS commented 5 years ago

@J16053 I have just a rough idea for solving a part of this issue. I think that one should get DOM trees with and without embedding a target script and find the difference between these two trees. This way you will know which nodes are getting affected/added/removed and it will help in highlighting that node.