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 #384

Open
maxweb4u opened this issue Nov 22, 2022 · 9 comments

Comments

@maxweb4u
Copy link

I have this mistake when installed latest version: 10.1.0

error

react-youtube: v10.1.0
react: 17.0.2

@Ojay
Copy link

Ojay commented Nov 28, 2022

Experiencing this too, same setup pretty much. I found this issue/fix on a different package which may help get this resolved.

@maxweb4u
Copy link
Author

Yes

Experiencing this too, same setup pretty much. I found this issue/fix on a different package which may help get this resolved.

yes I found this fix too, but it's on another package. And react-youtube doesn't provide an ability to add 'sandbox' property. So how could I add 'allow-presentation' to the sandbox for react-youtube.

@Ojay
Copy link

Ojay commented Nov 28, 2022

It was more posted for the devs to reference if/when they get to fixing it for this package. Unfortunately I don't think its possible to apply allow-presentation to react-youtube as is... 😕

@ruisaraiva19
Copy link
Collaborator

The YouTube iframe API already adds the sandbox attribute. Not sure we we should mess with it 👀

@yshterev
Copy link

sandbox seems to add allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox
The error is about allow-presentation which is missing.

@rnrajurkar
Copy link

rnrajurkar commented Dec 7, 2022

adding
player.h.attributes.sandbox.value = "allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-storage-access-by-user-activation allow-presentation"; adds allow-presentation but does not solve the problem
image

@oknaus-huemor
Copy link

Yes, iframe has allow-presentation but error still appears in console

@RexHung0302
Copy link

Does anyone fixed this yet ? I got same error...

@joshuagraber
Copy link

Having the same issue. The Options type coming from dist/youtube-player appears to be incomplete. Would it be possible to extend this type and add support for adding our own sandbox attributes? If contributions are welcome, I would be happy to raise a PR for this. It doesn't affect functionality, but all that red in my console bothers me.

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

8 participants