Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why inserting of YouTube video doesn't work in the case of nested frames

I have the following files:

index.htm

<!DOCTYPE html>
<html>
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <style>  
   iframe {
      border: none;
      display: block;
   }
   </style>
</head>    
<body>
   <iframe id="main-frame" src="child.htm" frameborder="0" sandbox="allow-same-origin" allowfullscreen></iframe>
</body>
</html>

child.htm

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<!DOCTYPE html>
<html>
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<iframe width="640" height="480" src="https://www.youtube.com/embed/jNQXAC9IVRw" 
        title="Me at the zoo" frameborder="0" sandbox="allow-same-origin"
        allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" 
        allowfullscreen>
</iframe>
</body>
</html>

If we run index.htm then we will get the error that js is unavailable. However, I checked the settings in my browser and claim that javascript is not blocked by it. I tested this in Firefox and Google Chrome and got the same error.

Q1: Why do we get an error about the unavailability of js?

Q2: How to fix it without changes of architecture of iframes?

>Solution :

sandbox="allow-same-origin allow-scripts" try again as.

and you can find the details here. enter link description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading