如何使用嵌入

时间:2019-06-01 12:37:57

标签: html css wordpress

我正在尝试使用<embed>,但获得的成功有限。例如,这两个URL不会嵌入。

<embed style="width: 500px; height: 300px;" 
  src="https://www.tate.org.uk" width="300" height="150">
</embed>
<embed style="width: 500px; height: 300px;" 
  src="http://www.northlondonreadinggroup.co.uk/" width="300" height="150">
</embed>

其他URL将...

https://adsler.co.uk/adsler-blog/

我遇到了以下问题:How Can I Bypass the X-Frame-Options: SAMEORIGIN HTTP Header?如果我将它们发布在网站标题中,可以绕过iframe限制吗?

<script 
src="https://unpkg.com/@ungap
/custom-elements-builtin"></script>
<script type="module" src="x-frame- 
bypass.js"></script>

1 个答案:

答案 0 :(得分:0)

如@showdev所述,您可以使用X-Frame-Options

以下是您的案例示例:

<!DOCTYPE html>
<html>
<script src="https://unpkg.com/@ungap/custom-elements-builtin"></script>
<script type="module" src="https://unpkg.com/x-frame-bypass"></script>
<body>

<h2>HTML Iframes</h2>
<p>You can use the height and width attributes to specify the size of the iframe:</p>

<iframe is="x-frame-bypass" src="https://www.tate.org.uk" height="150" width="300"></iframe>

<iframe is="x-frame-bypass" src="http://www.northlondonreadinggroup.co.uk/" height="150" width="300"></iframe>

</body>
</html>

这是我提到的示例:(只需单击运行)

https://www.w3schools.com/code/tryit.asp?filename=G4LYCU8V9ILG