Gutenberg: Embeds: handle `allow-presentation` JS error

Created on 3 Jul 2017  路  4Comments  路  Source: WordPress/gutenberg

Since we started sandboxing embeds (yay 馃帀), this error shows up in Chrome:

Uncaught DOMException: Failed to construct 'PresentationRequest': The document is sandboxed and lacks the 'allow-presentation' flag.
    at V.P (chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/cast_sender.js:76:87)
    at Object.chrome.cast.P (chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/cast_sender.js:91:165)
    at g.iI.g.h.init (https://www.youtube.com/yts/jsbin/player-vfleyMpxV/en_US/base.js:5817:509)
    at Swa (https://www.youtube.com/yts/jsbin/player-vfleyMpxV/en_US/remote.js:10:96)
    at Zwa (https://www.youtube.com/yts/jsbin/player-vfleyMpxV/en_US/remote.js:25:8)
    at window.chrome.window.chrome.cast.window.chrome.cast.isAvailable.window.__onGCastApiAvailable (https://www.youtube.com/yts/jsbin/player-vfleyMpxV/en_US/remote.js:60:200)
    at Object.chrome.cast.ea (chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/cast_sender.js:94:152)
    at chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/cast_sender.js:94:204
    at chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/cast_sender.js:94:326

I suspect the steps to reproduce, aside from using Chrome, is to have a Google Chromecast on your network. The error is likely from the YouTube embed in the demo content.

It's not necessary for users to be able to cast their YouTube videos, but it'd be nice if we could prevent the error from showing up. And per this https://stackoverflow.com/questions/30183320/iframe-sandboxing-with-allow-same-origin-flag-error, it's probably a matter of adding an attribute somewhere.

[Block] Embed [Type] Bug

Most helpful comment

      <iframe [src]="url"
              frameborder="1"
              sandbox="allow-scripts allow-same-origin allow-presentation">

worked for me

All 4 comments

      <iframe [src]="url"
              frameborder="1"
              sandbox="allow-scripts allow-same-origin allow-presentation">

worked for me

@notnownikki @jasmussen Why was this issue closed? Was it handled somewhere, or did we think it wasn't worth taking action?

Let's reopen and revisit!

Open to contributors!

@kwight I think it was closed after this PR was merged: https://github.com/WordPress/gutenberg/pull/1657

Since @jasmussen reviewed and confirmed that the PR does indeed fix the error, I'm going to close this issue. Feel free to reopen if needed!

Was this page helpful?
0 / 5 - 0 ratings