--- tags: hope --- # Seamless iframes The most secure way to embed doclets is by using an iframe. However an iframe has a fixed size and doesn't resize to fit its content. Google supported a 'seamless' attribute in Chrome 20-26, but has since dropped it. There are a number of attempts to implement it in javascript. All of them need the iframe.postMessage channel to allow cross domain communication. There is no way to implement a seamless iframe without both the host and the child frame working together. ## Issues 1. DOM elements obviously cannot extend outside the iframe borders. So you cannot create a DOM based popup or pullout, unless you keep careful track of the iframe size. Browser controls however can extend outside. That means the contextmenu, a select list, a datalist, etc. So if you want to use a pulldown menu, that may be too high for the iframe, you can use a select list for the options and a label to open/close it. 2. hope.seamless.js calculates the needed height for the iframe using the body.offsetHeight. This doesn't keep track of absolutely positioned elements. hope.seamless.js should probably allow you to inject your own height calculator function.