I am building an extension for Content management system admin UI. The extension is hosted by the CMS in a sandboxed iframe.
The purpose of the extension is to embed a youtube video so that the user is able to see its preview. So it is an iframe within the sandboxed iframe.
The problem I have is that the sandbox (parent iframe) doesn't have the allow-presentation
allowed, which is causing the following exception to fire in YouTube embed code:
DOMException: Failed to construct 'PresentationRequest': The document is sandboxed and lacks the 'allow-presentation'
The video works correctly, but the unhandled error is making unwanted debug breakpoints, and spams the browser console.
I have tried to disable fullscreen mode with ?fs=0
parameter but the code is still called and the error is still thrown.
Is there a way to make the embed code work without errors in an iframe that doesn't have allow-presentation enabled?