detect-zoom
detect-zoom copied to clipboard
Incorrect value for zoom inside iframe in Chrome
With the merge of https://github.com/tombigel/detect-zoom/pull/50, it appears that Chrome will report an incorrect value of the zoom level when inside an iframe of different width to the parent frame. window.outerWidth
seems to always reference to the total browser width, whereas window.innerWidth
references just the current frame's width.
Unfortunately, it seems Chrome does not allow cross domain access to top.innerWidth
so I am not sure of a way to get a proper value to compare against window.outerWidth
. Any thoughts on how we might be able to support iframes in Chrome?
If we use window.top.outerWidth
and window.top.innerWidth
and the iframe contains page that served from the same host, port and with same protocol, then it gives the correct value of zoom.