detect-zoom icon indicating copy to clipboard operation
detect-zoom copied to clipboard

Incorrect value for zoom inside iframe in Chrome

Open TCampaigne opened this issue 10 years ago • 1 comments

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?

TCampaigne avatar Jun 30 '14 19:06 TCampaigne

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.

kumar003vinod avatar Nov 24 '15 10:11 kumar003vinod