Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在Chrome扩展中嵌入YouTube视频时出现IntersectionObserver错误_Javascript_Google Chrome_Iframe_Google Chrome Extension_Youtube - Fatal编程技术网

Javascript 在Chrome扩展中嵌入YouTube视频时出现IntersectionObserver错误

Javascript 在Chrome扩展中嵌入YouTube视频时出现IntersectionObserver错误,javascript,google-chrome,iframe,google-chrome-extension,youtube,Javascript,Google Chrome,Iframe,Google Chrome Extension,Youtube,我已将YouTube视频嵌入我的Chrome扩展中页面的iframe中: <div id="container" class="streamContainer"> <iframe id="vid" class="streamEmbed" src="https://www.youtube.com/embed/prd2RfhF1tM" frameborder="0" allowfullscreen="false" ></iframe> </div&g

我已将YouTube视频嵌入我的Chrome扩展中页面的iframe中:

<div id="container" class="streamContainer">
    <iframe id="vid" class="streamEmbed" src="https://www.youtube.com/embed/prd2RfhF1tM" frameborder="0" allowfullscreen="false" ></iframe>
</div>
带有iframe的页面的完整html:

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title>Debate video player</title>
    <style>
        body {
            font-family: "Segoe UI", "Lucida Grande", Tahoma, sans-serif;
            font-size: 100%;
            margin:0;padding:0;height:100%;overflow: hidden;
        }

        html {margin:0;padding:0;height:100%;}

        #status {
            /* avoid an excessively wide status text */
            white-space: pre;
            text-overflow: ellipsis;
            overflow: hidden;
            max-width: 400px;
        }

        .streamEmbed {
            width: 100%    !important;
            height: 100%   !important;
        }

        .streamContainer {
            width: 100%    !important;
            height: 100%   !important;
        }
    </style>

    <script type="text/javascript" src="js/streamspage.js"></script>
</head>
<body>
    <div id="container" class="streamContainer">
        <iframe id="vid" class="streamEmbed" src="https://www.youtube.com/embed/prd2RfhF1tM" frameborder="0" allowfullscreen="false" ></iframe>
    </div>
</body>
</html>
// JavaScript source code
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = process;
window.onload = function () {
    xhr.open("GET", "https://raw.githubusercontent.com/ReportersLabDuke/FactPopUp/master/livestream_url", true);
    xhr.send();

}

function process()
{
  if (xhr.readyState == 4) {
    var url = xhr.responseText;
    console.log(url);
    document.getElementsByTagName("iframe")[0].setAttribute("src", url);
  }
}

请提供更多关于
HTML的上下文。请提供manifest.json,这样我们就可以大致了解事物的组织方式。我们需要能够复制这个问题。基本上,是需要一个我们可以用来复制问题,以便调查。谢谢!我已经添加了页面中的html以及页面上运行的清单和js。基本上,该页面只是占据整个页面的iframe。错误消息显示错误发生在YouTube播放器内部。我想说你无法修复它,通过提交错误报告让谷歌知道。我在这里与Chrome团队讨论了一个问题,请启动它。请提供更多关于
HTML的上下文。请提供manifest.json,这样我们就可以大致了解事物的组织方式。我们需要能够复制这个问题。基本上,是需要一个我们可以用来复制问题,以便调查。谢谢!我已经添加了页面中的html以及页面上运行的清单和js。基本上,该页面只是占据整个页面的iframe。错误消息显示错误发生在YouTube播放器内部。我想说你无法修复它,通过提交错误报告让谷歌知道。我已经在这里与Chrome团队讨论了一个问题,请启动它
<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title>Debate video player</title>
    <style>
        body {
            font-family: "Segoe UI", "Lucida Grande", Tahoma, sans-serif;
            font-size: 100%;
            margin:0;padding:0;height:100%;overflow: hidden;
        }

        html {margin:0;padding:0;height:100%;}

        #status {
            /* avoid an excessively wide status text */
            white-space: pre;
            text-overflow: ellipsis;
            overflow: hidden;
            max-width: 400px;
        }

        .streamEmbed {
            width: 100%    !important;
            height: 100%   !important;
        }

        .streamContainer {
            width: 100%    !important;
            height: 100%   !important;
        }
    </style>

    <script type="text/javascript" src="js/streamspage.js"></script>
</head>
<body>
    <div id="container" class="streamContainer">
        <iframe id="vid" class="streamEmbed" src="https://www.youtube.com/embed/prd2RfhF1tM" frameborder="0" allowfullscreen="false" ></iframe>
    </div>
</body>
</html>
// JavaScript source code
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = process;
window.onload = function () {
    xhr.open("GET", "https://raw.githubusercontent.com/ReportersLabDuke/FactPopUp/master/livestream_url", true);
    xhr.send();

}

function process()
{
  if (xhr.readyState == 4) {
    var url = xhr.responseText;
    console.log(url);
    document.getElementsByTagName("iframe")[0].setAttribute("src", url);
  }
}