有没有办法制作一个iframe YouTube浏览器



我试图使用iframe制作一个YouTube视频搜索器,但由于某种原因,它似乎没有加载。

这是我的代码:

<!DOCTYPE html>
<html>
<head>
<httpProtocol>
<customHeaders>
<add name="X-Frame-Options" value="SAMEORIGIN" />
<add name="Content-Security-Policy" value="frame-ancestors https://www.<preferredwebsitedomain>.com" />
</customHeaders>
</httpProtocol>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Youtube Browser</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form action="http://www.youtube.com/results" method="get" target="iframe">
<input id="search_query" type="text"/>
<input type="submit"/>
</form> 
<iframe name="iframe"></iframe>
</body>
</html>

有人能帮我解决这个问题吗?

您似乎无法:

";拒绝显示'https://www.youtube.com/',因为它将"X-frame-Options"设置为"sameoorigin">

Youtube服务器X-Frame-Options只允许使用sameorigin

关于这个主题的更多信息点击这里

最新更新