Mac/Safari sometimes the preview iframe content doesn't load

Created on 2 July 2025, about 17 hours ago

Overview

Some kind of race condition that seems to specifically effect Safari/webkit means that despite the srcdoc being set of the preview canvas iframe, the actual content of the iframe doesn't load in resulting in the following seemingly impossible situation in the DOM

<iframe class="_preview_i3030_1" data-test-xb-content-initialized="true" data-xb-iframe="B" data-xb-preview="true"
        data-xb-swap-active="true"
        scrolling="no" srcdoc="<!DOCTYPE html>
<html dir=&quot;ltr&quot; lang=&quot;en&quot; style=&quot;--color--primary-hue:202;--color--primary-saturation:79%;--color--primary-lightness:50&quot;>
    <head>
        [...trimmed]
    </head>
    <body class=&quot;toolbar-loading user-logged-in path-xb&quot;>
        <a class=&quot;visually-hidden focusable skip-link&quot; href=&quot;#main-content&quot;>Skip to main content</a>
        <div class=&quot;dialog-off-canvas-main-canvas&quot; data-off-canvas-main-canvas>
        
            <div class=&quot;page-wrapper&quot; id=&quot;page-wrapper&quot;>
                <div id=&quot;page&quot;>
                    <header class=&quot;site-header&quot; data-drupal-selector=&quot;site-header&quot; id=&quot;header&quot; role=&quot;banner&quot;>
                        [...trimmed]
                    </header>
        
                    <div class=&quot;layout-main-wrapper layout-container&quot; id=&quot;main-wrapper&quot;>
                        [... trimmed]
                    </div>
        
                    <footer class=&quot;site-footer&quot;>
                        [...trimmed]
                    </footer>
                    <div class=&quot;overlay&quot; data-drupal-selector=&quot;overlay&quot;></div>
                </div>
            </div>
        </div>
        [...trimmed]
    </body>
</html>" style="display: block;" tabindex="-1" title="Preview">
    <html style="overflow: hidden; min-height: 768px;">
    <head></head>
    <body style="min-height: 768px;"></body>
    </html>
</iframe>

Note that the srcdoc has a full HTML document but the iframe's content is just an empty head and body tag.

See screen recording for what this looks like in practice.

Proposed resolution

Perhaps detect the failed iframe initialisation and re-try it.

User interface changes

🐛 Bug report
Status

Active

Version

0.0

Component

Page builder

Created by

🇬🇧United Kingdom jessebaker

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024