我正在尝试使用 <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>
最佳答案
正如@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
关于html - 如何使用嵌入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56406820/