javascript JQuery 2.0.3 Chrome 错误资源必须列在 web_accessible_resources 清单键中才能被扩展程序之外的页面加载
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18430879/
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
JQuery 2.0.3 Chrome Error Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension
提问by LoneWolfPR
I'm building out an HTML5 page. I'm using JQuery in it, and I'm getting the following two console errors.
我正在构建一个 HTML5 页面。我在其中使用 JQuery,但出现以下两个控制台错误。
Denying load of chrome-extension://kkelicaakdanhinjdeammmilcgefonfh/js/jquery.min.map. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension. localhost/:1
GET chrome-extension://invalid/ chrome-extension://invalid/:1
As far as I can tell everything is declared normally. Here's the top of my html page
据我所知,一切都正常声明。这是我的 html 页面的顶部
<!DOCTYPE HTML>
<html>
<head>
<title>Page Title</title>
<link href="css/main.css" type="text/css" rel="stylesheet" />
<link href="css/archivo-narrow.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="scripts/jquery-2.0.3.min.js"></script>
</head>
What's triggering this error?
是什么触发了这个错误?
采纳答案by MercOZ
If you are using the Chrome extension Windows Resizer it could be to do with that see http://windowresizer.userecho.com/topic/185143-exception-in-development-tools-in-chrome-dev-m-29015302-66-and-29015353-611/I am getting the same error. If I disable the extension I no longer get the error.
如果您使用的是 Chrome 扩展 Windows Resizer,则可能与此有关,请参阅http://windowresizer.userecho.com/topic/185143-exception-in-development-tools-in-chrome-dev-m-29015302-66 -and-29015353-611/我遇到了同样的错误。如果我禁用扩展,我将不再收到错误消息。
回答by pveyes
When you don't use jQuery from CDN (you download jQuery for yourself, then include it), it will failed to find its source map, to fix this error download jquery source map
当你不使用 CDN 的 jQuery 时(你自己下载 jQuery,然后包含它),它会找不到它的源映射,解决这个错误下载 jquery 源映射
You can find source map path in Resource Tabin Developer Tool, then open your jQuery file, you will find something like this
你可以在开发者工具的资源标签中找到源映射路径,然后打开你的jQuery文件,你会发现这样的东西
/*! jQuery v2.0.3 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
//@ sourceMappingURL=jquery-2.0.3.min.map
*/
Then go to http://code.jquery.com/sourceMappingURL, in this case = http://code.jquery.com/jquery-2.0.3.min.map, then save it in same directory as you save your jQuery file
然后转到http://code.jquery.com/sourceMappingURL,在这种情况下 = http://code.jquery.com/jquery-2.0.3.min.map,然后将其保存在与保存 jQuery 相同的目录中文件
回答by Allen Chak
If you just want to temperately remove this message, turn off the source maps.
如果您只想温和地删除此消息,请关闭源映射。
For Chrome User: press Ctrl + Shift + I, click the gear icon in right hand side to open the Settings, un-check the Enable source maps.
对于 Chrome 用户:按 Ctrl + Shift + I,单击右侧的齿轮图标打开Settings,取消选中Enable source maps。
For other user, read it Developer Tools - Source maps
对于其他用户,请阅读开发者工具 - 源地图
Detail of problem: it is because the page included a minified JS/CSS/resource, and it was attached a mapping path of original file. Unfortunately, the file is missing in mapping path.
问题详情:是因为页面包含了一个缩小的JS/CSS/资源,并且附加了原始文件的映射路径。不幸的是,该文件在映射路径中丢失。
回答by saadsaf
Did u registered all ur files correctly in the chrome manifest file? I Guess something is wrong there
您是否在 chrome manifest 文件中正确注册了所有文件?我想那里有问题