A fallback that emulates the main features of the seamless iframe.
"The browser should render the frame in a way that makes it appear to be part of the containing document."
Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#Attributes
Seamless Iframe will:
- open any anchor in the parent, unless you specify otherwise,
- inherit the CSS declarations from the parent,
- behave as block element, adjusting its size to its content.
Link to /dist/seamless-parent.css
file:
<link rel="stylesheet" href="/dist/seamless-parent.css"/>
or include its declaration in your CSS:
iframe[seamless] {
background-color: transparent;
border: none;
overflow: hidden;
padding: 0;
margin: 0;
}
Link to /dist/seamless-parent.js
file:
<script src="/dist/seamless-parent.js"></script>
Include the seamless
attribute (boolean) to your iframes as defined by W3C.
<iframe src="..." seamless></iframe>
Link to /dist/seamless-iframe.css
file:
<link rel="stylesheet" href="/dist/seamless-iframe.css"/>
or include its declaration in your CSS:
html {
width: intrinsic; /* Safari/WebKit uses a non-standard name */
width: -webkit-max-content;
width: -moz-max-content; /* Firefox/Gecko */
width: max-content;
width: fit-content;
}
Link to /dist/seamless-iframe.js
file:
<script src="/dist/seamless-iframe.js"></script>
- Support IE.
- Continue event bubbling from iframe to the parent document.
- Expose a method that allow to suscribe to the iframe messages to extend the functionality.
- Also see the issue tracker.
- Tested in most of mayor browsers.