I am trying to append a script to any web site, using for example Chrome extensions. When the extension is on, the JavaScript would listen to the mouseenter
event but not click event (because it would usually make the page jump to an other page)
My question is: can I cache the all the click events on page when my extension is on and recover them when off? Like:
//on
for node in document
old-click = node.click
node.click = null
node.addEventListener 'off', (e)->
node.click = old-click
Or can I add a mask to the page that can stop click event to bubble but allow the mousemove
event to bubble to the below element (only one but not bubble to all elements below)?
//click event
$(document).on 'click', '*', (event)->
event.stopPropagation()
$(document).on 'mousemove', '*', (event)->
//event.bubbleToNextBelowElement