1

I know that it's possible to set an onmousemove listener and that it can be attached both to individual objects as well as well as window which will track x,y coordinates all over.

Is it possible to scan a page and see which elements have onmousemove attached, including window? (Same goes for onmousedown or whatever else)

Community
  • 1
  • 1
dsp_099
  • 5,801
  • 17
  • 72
  • 128
  • i just wrote something to iterate the dom elements and check if onmouse event is attached.. you can add any other events there if required let me know if this works for you i can post as answer var x=document.getElementsByTagName("*"); for(var i=0;i – sumeet kumar Aug 21 '15 at 02:05
  • Take a look at the link in my post. Run the tracking script in the answer and then run your tidbit - doesn't log anything :/ – dsp_099 Aug 21 '15 at 02:25
  • https://jsfiddle.net/1s6v3ag3/ here is the code with a example it will put the element on console which has onmouse move element defined. let me know if you have any issues – sumeet kumar Aug 21 '15 at 02:49
  • As you can see in script its checking all the element in the document but not in the document. document checking can be added as document['onmousemove'] is null or not to identify that as well!! just tested it worked !! – sumeet kumar Aug 21 '15 at 03:03

0 Answers0