Search code examples
htmlflashiframesandbox

Flash not work in iframe within sandbox attribute


I've used iframe to show some pages.These pages may contain an adobe flash content like a video. my problem is that the abode flash doesn't execute in an iframe within sandbox attribute. my iframe tag :

<iframe sandbox="allow-popups allow-pointer-lock allow-same-origin allow-forms allow-scripts" src="http://example.com"></iframe>

Solution

  • Short answer: you can't execute flash plugin in a sandboxed iframe.

    The spec : http://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-sandbox

    Plugins that cannot be secured are disabled in sandboxed browsing contexts because they might not honor the restrictions imposed by the sandbox (e.g. they might allow scripting even when scripting in the sandbox is disabled). User agents should convey the danger of overriding the sandbox to the user if an option to do so is provided.

    For comprehensive information about sandbox attribute: http://blog.dareboost.com/en/2015/07/securing-iframe-sandbox-attribute/