简体   繁体   中英

JavaScript - Detecting Scrollbars in a Cross-Domain Iframe?

I'm loading a cross-domain page (that I have no control over) into an iframe.

I want to know if this results in a scrollbar appearing in the iframe on my page or not.

I'm getting the impression that this just cannot be done (in Firefox at least), through any kind of direct detection or clever deduction, due to cross-domain security policies.

Please only answer this question if you have direct experience successfully doing this yourself -- or trying everything and giving up.

(Those other discussions you want to refer me to don't work for cross-domain iframes with no control over the embedded page. And if you think jQuery must have something for this, please test it out first yourself to make sure.)

TIA -- I don't have an SO account to respond to your answers. (do now)

It is not possible to do this because of the browser's security model. If it was possible, that would be a security problem and would have to be fixed. See my complete answer to this similar question for a more complete explanation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM