DataTables / VisualEvent

Visually show Javascript events on a page
http://sprymedia.co.uk
1.04k stars 161 forks source link

Finding events inside a shadow element #61

Open valtido opened 8 years ago

valtido commented 8 years ago

Consider the following.

<sometag .... >
   --shadowRoot--
         <style>...</style>
        <a id="test"></a>
        <script>
              $('a').on('click', function(event){  ....  })
       </script>
</sometag>

The problem is, these event's are not picked up from the VisualEvent:

Here is a way to find elements inside a shadowRoot element.

var all = document.querySelectorAll("*");
var length =  all.length
for(i= 0; i < length; i++){
  if(all[i],shadowRoot) all.concat(all[i].shadowRoot.querySelectorAll("*"));
}

Of course this is a quick and dirty way of archiving this, but may need a bit more thought and work on to it.

Let me know your thoughts.

DataTables commented 8 years ago

Sounds useful - thanks! I'm not likely to have much time to look into this any time soon, but I will do so as soon as I get a chance.

valtido commented 8 years ago

Let me know if you need a demo page. I can set it up for you to test it on.