Reputation: 2419
I'm developing Firefox extension. For some statistics I need actual display coordinates of DOM Element inside browser.
I can get coordinates of:
getBoundingClientRect()
(this takes scrolling into account, perfect).ChromeWindow
) itself by checking it's screenX
& screenY
properties.But when I call getBoundingClientRects()
of browser, I get it coordinates excluding the size of window frame & borders drawn by system (tested on Mac). How to also count their (borders & frames) size independently for different operating systems?
Is it possible at all?
Upvotes: 0
Views: 269
Reputation: 1375
How about window.screenX or window.mozInnerScreenX? Respectively screenY, etc.
If that doesn't work, you could probably use js-ctypes to call OS-functions, which i guess are able to let you calculate the border size. On Windows you'd use GetWindowRect and GetClientRect as explained in this thread. No idea how this is possible in OSX though, but there surely is a way ...
Good luck!
Upvotes: 1