For the following iframe code:
<iframe src="testA.html" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
Inside testA.html, how do I tell if the webkitAllowFullScreen attribute is included using javascript?
The sandbox attribute enables an extra set of restrictions for the content in the iframe. When the sandbox attribute is present, and it will: treat the content as being from a unique origin. block form submission. block script execution.
You cannot fix this from Power Apps Portal side. Most probably web site that you try to embed as an iframe doesn't allow to be embedded. You need to update X-Frame-Options on the website that you are trying to embed to allow your Power Apps Portal (if you have control over that website).
The srcdoc attribute specifies the HTML content of the page to show in the inline frame. Tip: This attribute is expected to be used together with the sandbox and seamless attributes. If a browser supports the srcdoc attribute, it will override the content specified in the src attribute (if present).
If the allowfullscreen attributes are added to the iframe the variable below should be true
var fullscreenEnabled = document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled;
This even works when the iframe src is on a different domain.
Note: the letter s in fullscreenEnabled is uppercase for Firefox
This is the most robust solution:
if(window.frameElement && window.frameElement.hasAttribute("webkitAllowFullScreen")){
}
It utilizes window.frameElement
, which returns the DOM node of the parent framing element, which you can then make a hasAttribute
call against.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With