Problem/Motivation
We have been using the Iframe module for years to embed lazy-loading <iframe> static HTML 'Explainers' on our educational website to great effect.
Our site students can view our Explainers embedded within the tutorial pages like this and opt to snap the …

The underlaying markup for the <iframe> rendered as…
<iframe class=" lazyloaded" width="100%" height="701" name="iframe-field_iframe-870" id="iframe-field_iframe-870"
title=""
allow="accelerometer;autoplay;camera;encrypted-media;geolocation;gyroscope;microphone;payment;picture-in-picture"
allowfullscreen="allowfullscreen" loading="lazy"
data-src="https://sirclickalot.co.uk/assets/books/gcse-computer-science-plus/chapters/data-representation/topics/binary-numbers/explainers/what-is-binary">
Your browser does not support iframes, but you can visit <a
href="https://sirclickalot.co.uk/assets/books/gcse-computer-science-plus/chapters/data-representation/topics/binary-numbers/explainers/what-is-binary"></a>
</iframe>
It all worked beautifully ;-?)
However, since updating to 3.01 with it subsequent change the way that the 'Allow full screen' option is handled, the underlaying markup is now…
<iframe class=" lazyloaded" width="100%" height="701" name="iframe-field_iframe-870" id="iframe-field_iframe-870"
title=""
allow="accelerometer;autoplay;camera;encrypted-media;geolocation;gyroscope;microphone;payment;picture-in-picture;fullscreen"
loading="lazy"
data-src="https://sirclickalot.co.uk/assets/books/gcse-computer-science-plus/chapters/data-representation/topics/binary-numbers/explainers/what-is-binary">
Your browser does not support iframes, but you can visit <a
href="https://sirclickalot.co.uk/assets/books/gcse-computer-science-plus/chapters/data-representation/topics/binary-numbers/explainers/what-is-binary"></a>
</iframe>
…and our JS-powered snap to full screen links no longer work reporting (JS Console)…

We immediately went back to the field settings to check that Boolean value for the 'allow full screen' toggle but it was TRUE as expected…

We have left 3.01 deployed here as an publicly-accessible example of the breakage...
https://bit-by-bit.org/node/251
Downgrading back to 3.00 and we all good again.
| Comment | File | Size | Author |
|---|---|---|---|
| iframe_module_in_action.png | 68.73 KB | sirclickalot | |
| iframe_module_console_report.png | 14.56 KB | sirclickalot | |
| iframe_module_allow_full_screen_field_setting.png | 10.8 KB | sirclickalot |
Issue fork iframe-3603949
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
smustgrave commentedSeems like a regression.
Comment #3
sirclickalotWhile I agree that the
"allowfullscreen"attribute is considered a legacy attribute and redefined asallow="fullscreen"It does appear that actually removing the
allowfullscreen="allowfullscreen"might be jumping the gun a little.Perhaps the nest middle ground is to add to the
allowas below…allow="accelerometer;autoplay;camera;encrypted-media;geolocation;gyroscope;microphone;payment;picture-in-picture;fullscreen"But also keep:
allowfullscreen="allowfullscreen"for now?I have downgraded the live example now (to module v3.00) at: https://bit-by-bit.org/node/251
Comment #5
smustgrave commentedComment #6
sirclickalotThanks @smustgrave.
I have applied the patch (
30.patch) from the MR and it seems to have fixed the issue of allowing the full screen links to work again.You can see it in action with multiple <iframe> elements on a page here: https://bit-by-bit.org/node/6897
With the 3.00 version of the module, I had overridden the
iframe.html.twigtemplate to allow for lazy loading (we use the Lazy module (https://www.drupal.org/project/lazy) for this.The only edits are to the <iframe> element of template and they looked like this...
HOWEVER, as demonstrated on https://bit-by-bit.org/node/6897 the <iframe> no longer lazy loads and the whole page has to load in full.
On inspecting the resultant markup, the 'laziness' is all there but I notice that despite there being no space in <iframe>
classattribute in my custom template, that one is inserted when the <iframe> is rendered...I am not sure if that is the likely cause?
As you might imagine, with pages such is this containing multiple <iframe> elements, the lazy-loading was an important asset so it would be nice to have it functioning again.
Thanks
Comment #7
angel_devoeted commentedTested
MR !30via DrupalPod. It fixes the fullscreen regression introduced in3.0.1.Regarding #6, this MR does not cause the lazy loading issue or the malformed class attribute.
That regression seems to come from the
3.0.1release itself due to how thesrcattribute is handled in the attributes object, which prevents the Lazy module from altering it.@sirclickalot, maybe it would be a good idea to open a separate issue for lazy loading?
Since the lazy loading issue is unrelated, the MR looks good.
Comment #8
sirclickalotThank you @angel_devoeted, that's a very useful insight!
I have detailed it here: https://www.drupal.org/project/iframe/issues/3607132
Comment #9
smustgrave commentedSo this fixes the issue?
Comment #10
angel_devoeted commentedYes, this MR fixes the fullscreen regression.
Comment #11
smustgrave commented