ilyashubin / hover-inspect

Element inspector extension for Chrome

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work for disabled elements

sethlivingston opened this issue · comments

This is a great little tool. It would be nice to be able to hover over disabled elements, though.

Hi, thanks for the report. I'm glad it helped someone :)
Disabled elements don't fire mouse events, thats how browsers work. I also want to inspect disabled elements, but I think there's no simple solution for this.

commented

I got a clue, listener mousemove event instead of focus, and use document.elementFromPoint to get the hovered element.

And, I have a question of codes:

var shadow = this.$host.createShadowRoot();
document.body.appendChild(this.$host);
var templateMarkup = document.createElement("div");
templateMarkup.innerHTML = this.template;
shadow.innerHTML = templateMarkup.querySelector('template').innerHTML;

Why wrap the template with template tag? It seems unnecessary.