react-youtube
react-youtube copied to clipboard
Uncaught DOMException: Failed to construct 'PresentationRequest': The document is sandboxed and lacks the 'allow-presentation' flag
I have this mistake when installed latest version: 10.1.0
react-youtube: v10.1.0 react: 17.0.2
Experiencing this too, same setup pretty much. I found this issue/fix on a different package which may help get this resolved.
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.
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... 😕
The YouTube iframe API already adds the sandbox
attribute. Not sure we we should mess with it 👀
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.
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
Yes, iframe has allow-presentation but error still appears in console
Does anyone fixed this yet ? I got same error...
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.