Javascript cast_sender.js 错误:无法加载资源:Chrome 中的 net::ERR_FAILED
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25814914/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
cast_sender.js error: Failed to load resource: net::ERR_FAILED in Chrome
提问by Alex
I recently started receiving the following console errors, without any code changes taking place.
我最近开始收到以下控制台错误,但没有发生任何代码更改。
I did not install any extensions recently.
我最近没有安装任何扩展。
Failed to load resource: net::ERR_FAILED chrome-extension://enhhojjnijigcajfphajepfemndkmdlo/cast_sender.js
Failed to load resource: net::ERR_FAILED chrome-extension://hfaagokkkhdbgiakmmlclaapfelnkoah/cast_sender.js
Failed to load resource: net::ERR_FAILED chrome-extension://enhhojjnijigcajfphajepfemndkmdlo/cast_sender.js
Failed to load resource: net::ERR_FAILED chrome-extension://fmfcbgogabcbclcofgocippekhfcmgfj/cast_sender.js
Failed to load resource: net::ERR_FAILED
I have several YouTube player embeds on the page that are triggering this error, but they are simple:
我在页面上嵌入了几个触发此错误的 YouTube 播放器,但它们很简单:
<iframe width="100%" height="100%" src="http://www.youtube.com/embed/OUR_YOUTUBE_ID?showinfo=0&wmode=transparent" frameborder="0" allowfullscreen=""></iframe>
Has anybody else experienced this?
有没有其他人经历过这种情况?
采纳答案by isherwood
Apparently YouTube constantly polls for Google Cast scripts even if the extension isn't installed.
显然,即使未安装扩展程序,YouTube 也会不断轮询 Google Cast 脚本。
From one commenter:
来自一位评论者:
... it appears that Chrome attempts to get cast_sender.js on pages that have YouTube content. I'm guessing when Chrome sees media that it can stream it attempts to access the Chromecast extension. When the extension isn't present, the error is thrown.
...似乎 Chrome 试图在包含 YouTube 内容的页面上获取 cast_sender.js。我猜当 Chrome 看到它可以流式传输的媒体时,它会尝试访问 Chromecast 扩展程序。当扩展名不存在时,会抛出错误。
The only solution I've come across is to install the Google Castextension, whether you need it or not. You may then hide the toolbar button.
我遇到的唯一解决方案是安装Google Cast扩展程序,无论您是否需要。然后您可以隐藏工具栏按钮。
For more information and updates, see this SO question. Here's the official issue.
回答by sompylasar
I'm going to add to the answer given before.
It's not a bug in your code or the browser's code. It's the JavaScript code insidethe YouTube iframe polls for the extensions it could interoperate with in case they were installed (likely to determine if the extension is installed).
这不是您的代码或浏览器代码中的错误。这是JavaScript代码里面YouTube的IFRAME轮询可能在情况下,他们被安装互操作的扩展(有可能确定是否安装了扩展)。
Look at the source of www-embed-player.js(loaded from s.ytimg.com, it's YouTube static files CDN).
You'll find the following:
查看源代码www-embed-player.js(从 加载s.ytimg.com,它是 YouTube 静态文件 CDN)。您会发现以下内容:
function Wj(a){return"chrome-extension://"+a+"/cast_sender.js"}
回答by developer1011
To stop seeing those cast_sender.js errors, edit the youtube link in the iframe src and change embedto v
要停止看到那些 cast_sender.js 错误,请编辑 iframe src 中的 youtube 链接并更改embed为v
回答by user5775253
The error is try to fix a Youtube error.
该错误是尝试修复 Youtube 错误。
The solution to avoid your Javascript-Console-Error complex is to accept that Youtube (and also other webpages) can have Javascript errors that you can't fix.
避免 Javascript-Console-Error 复杂的解决方案是接受 Youtube(以及其他网页)可能存在您无法修复的 Javascript 错误。
That is all.
就这些。
回答by bdereta
In addition to what was already said - in order to avoid this error from interfering (stopping) other Javascript code on your page, you could try forcing the YouTube iframe to load last - after all other Javascript code is loaded.
除了已经说过的 - 为了避免此错误干扰(停止)您页面上的其他 Javascript 代码,您可以尝试强制 YouTube iframe 最后加载 - 在加载所有其他 Javascript 代码之后。
回答by Mark Kimitch
A simple fix for this is to install the Google Castextension. If you don't have a Chromecast, or don't want to use the extension, no problem; just don't use the extension.
对此的一个简单解决方法是安装Google Cast扩展程序。如果您没有 Chromecast,或者不想使用扩展程序,没问题;只是不要使用扩展名。

