admin管理员组

文章数量:1122826

I have a vimeo-iframe inside another iframe:

    <iframe id="mediaIframe" webkitallowfullscreen="true" mozallowfullscreen="true" allowfullscreen="" allowtransparency="true" src="; allow="autoplay; fullscreen; picture-in-picture; clipboard-write"></iframe>

When vimeo is ready it sends an error box to the user:

mydomain says {"event":"ready"}

How do I prevent this alert or respond in time to break the chain of events?

Without the outer iframe everything runs properly. Brave, Chrome, Safari, FF –– all the same.
I’ve tried without success a)

    var vplayer = new Vimeo.Player(document.getElementById('mediaIframe');
    vplayer.off('ready');

// no effect

b)

    window.onmessage = function (event) {
        if (event.origin === '') {
            return true;
        }
    };

// this is called only after the alert

iframes with Youtube, Internet Archive, matterport, dailymotion work fine.
Sketchfab iframes have a similar issue. They post a load message that I cannot catch yet.

本文标签: How to catch error message from vimeo or sketchfab iframe inside an iframeStack Overflow