5digits / dactyl

Pentadactyl and other related Gecko extensions
Other
470 stars 98 forks source link

MouseEvent : elementFromPoint doesn't give correct output #75

Open damlatien opened 9 years ago

damlatien commented 9 years ago

Dear developers, when I try to get the id under mouse cursor with a "click" event listener

window.addEventListener('click', function(e) {
var x = e.clientX, y = e.clientY;
var elementMouseIsOver = document.elementFromPoint(x, y);
console.log(elementMouseIsOver);
});

(in a function stored in ./pentadactyl/plugins), I always get the following :

<tabbrowser id="content" flex="1" contenttooltip="aHTMLTooltip" tabcontainer="tabbrowser-tabs" contentcontextmenu="contentAreaContextMenu" autocompletepopup="PopupAutoComplete" selectmenulist="ContentSelectDropdown" style="background-color: rgb(255, 255, 255);">

regardless of the location of the cursor. Could you help me to get the right thing, namely the object under the cursor ? Thanks.

eric-andrew commented 8 years ago

maybe this has to do with the positioning of the element itself. i'm having trouble with flex box and elementFromPoint right now too.