In Firefox, you can use mozInnerScreenX
and mozInnerScreenY
properties to get the screen coordinates of the upper-left corner of the current viewport. This also works for code that is executing in the context of an iframe, in that it will return the screen coordinates of the upper-left corner of the iframe’s visible area on screen.
However, mozInnerScreenX
, and mozInnerScreenY
are non-standard and only work in Firefox. Is there a way to do the same thing in Chrome?