![]() ![]() This sandboxing approach is also forced to all the child iframe elements the embedded content might have so landing pages might fail even if the element itself seems to be working.Īlong with that, the amp-iframe does not have any means passing configuration to the iframe and has no mechanism allowing it to be resized by the content held within. with such restricting standard we could expect restrictions here as well – all the amp-iframe elements are sandboxed by default – all the scripts and APIs form submissions and automatically triggered features are blocked and if you want some of them actually working on your AMP page you need to explicitly allow it adding a sandbox attribute to your amp-iframe and defining in its value the items to allow separated by space. There is an exclusion of this rule - amp-iframe element can be positioned higher in case it carrying the placeholder attribute and getting displayed until the amp-iframe gets actually loaded. As a rule, an amp-iframe should not take place in the first 600px of the document's height or in the first 75% of the viewport's height – according to which of those values comes to be the smaller one. The AMP developers claim their element is quite different from the vanilla iframe object – it is much more secured and not allowing a single iframe to dominate over the entire AMP Landing Page Template for a reason. ![]() Now, when the AMP iframe component has been included, let's get to know it a bit better. It all pretty much narrows down to a single script tag you would want to include: ![]() Here are a few things about the amp-iframe to get you started:įirst of all amp-iframe is the part of AMP's extended Components – you can't just use it in the markup you are about to define – you need to call the script handling it in the page's first. Of course, there are still plenty of restrictions to pay attention for in order to get the Validation's approval but at least including a bit more complicated content is not a chimera as it might seem like at first. The answer is YES - AMP pages can carry custom scripts and more complicated content as long as it's being a part of a different web page published somewhere aside and just referenced in the AMP page via an amp-iframe element. At the certain point that can be understood – removing tons of stuff will definitely make a page using AMP Layout Template load faster but what comes to be done when some custom script elements just need to take place? Are such pages suitable for transforming to AMP? So, no matter, what is our personal opinion about, this whole thing making sense or not, in a world, overruled by a particular search engine, this AMP thing about is definitely worth the shot.Īt first glance it all can be summarized by a single word – "RESTRICTIONS" – you can't have your own style sheets, run your own scripts and some of the tags must carry different AMP-specific names instead of the ones we are used to in a regular HTML. AMP claim to be providing faster and better user experience and in order to support them, Google, in turn, claims that sites having AMP mirrors will get their content higher ratings and places in the search results list. AMP IFrame - amp-iframe examples and tricks Embedding iframes in AMPĪs we talked before, Accelerated Mobile pages of AMP are one of the latest trends powered and pushed up by Google.
0 Comments
Leave a Reply. |