Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught DOMException: Failed to construct 'PresentationRequest': The document is sandboxed and lacks the 'allow-presentation' flag. #3

Open
nickgayo12 opened this issue Jul 11, 2020 · 10 comments

Comments

@nickgayo12
Copy link

This package for me is awesome, can embed different video links in just one element, Thanks to this.

However, I'd encounter an error. Youtube embed links produce error it says. Failed to construct 'PresentationRequest': The document is sandboxed and lacks the 'allow-presentation' flag.

image

Thanks.

@antoineguillaume
Copy link

Hey @nickgayo12

To solve this issue, you simply need to add allow-presentation to the sandbox attribute on the iframe.

<iframe
  sandbox="allow-forms allow-scripts allow-pointer-lock allow-same-origin allow-top-navigation allow-presentation"
  class="embed-responsive-item"
  allowfullscreen
  :src="url"
>
</iframe>

@dmyers
Copy link

dmyers commented Aug 5, 2020

@antoineguillaume Is there an easy way to do that or do you have to extend the package somehow?

@nasa8x
Copy link
Owner

nasa8x commented Aug 5, 2020

Added allow-presentation

@dmyers
Copy link

dmyers commented Aug 5, 2020

That worked for me. Thanks @nasa8x

@scottnc27603
Copy link

We're loading:
<script type="text/javascript" src="https://www.youtube.com/iframe_api"></script>
Is there a different script we should add? We are getting the PresentationRequest error.

@FuruholmAnton
Copy link

How can I do it if I create the iframe with the YouTube's Iframe Player API?
I saw one person recommending to add player.h.attributes.sandbox.value = "allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation"; after new YT.Player(... but for me I still get the error.

@Seungwoo321
Copy link

I have the same issues as @scottnc27603 and @FuruholmAnton .

@Odd-lad
Copy link

Odd-lad commented Dec 9, 2022

Me too, same issue. I've been going round in circles trying to fix it.

@15826954460
Copy link

I have do with it, but still error
image
image
image

@Spomsoree
Copy link

I've got the same problem.

It seems like something changed, this error was not displayed at the time i've implemented it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants