javascript ERR_FILE_NOT_FOUND,谷歌浏览器扩展

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28554805/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 09:10:36  来源:igfitidea点击:

ERR_FILE_NOT_FOUND, Google Chrome Extension

javascriptgoogle-chromegoogle-chrome-extensionfile-not-found

提问by Akash R

Im trying to build google chrome extension. Below is my manifest file; I searched every where and took every step to resolve chrome-extension://ijkjkkkinepajpigeijodppknjgdooef/popup.htmlError code: ERR_FILE_NOT_FOUND

我正在尝试构建 google chrome 扩展。以下是我的清单文件;我搜索了每个地方并采取了每一步来解决 chrome-extension://ijkjkkkinepajpigeijodppknjgdooef/popup.html错误代码:ERR_FILE_NOT_FOUND

{
"manifest_version": 2,
"update_url": "http://clients2.google.com/service/update2/crx",
"name": "Game Extension",
"version": "1.2.0",
"description": "Just for Fun",
"icons": {
"256": "img/icon.png"
},
"browser_action": {
"default_popup": "popup.html"
},
"permissions": [
"tabs",
"identity",
"http://*/*", 
"https://*/*"
],
"oauth2": {

"client_id": "232343423423PrivateClientKey",
"scopes": ["https://www.googleapis.com/auth/userinfo.email"] 
}
}

I have done everything , but issue is still there. Also,inside Extension

我已经做了一切,但问题仍然存在。此外,内扩展

folder(**%LOCALAPPDATA%\Google\Chrome\User Data**),like other extensions my extension has no folder.

文件夹(**%LOCALAPPDATA%\Google\Chrome\User Data**),和其他扩展一样,我的扩展没有文件夹。

Please let me know what is going wrong.

请让我知道出了什么问题。

回答by Xan

Presumably, you are loading an unpacked extension.

据推测,您正在加载一个解压缩的扩展。

Suppose you have a folder where your manifest.jsonfile is. For the sake of an example, C:\Development\MyTestExtension

假设您有一个文件夹,您的文件所在的manifest.json文件夹。举个例子,C:\Development\MyTestExtension

Then this folder becomes the root for the extension (in your case, chrome-extension://ijkjkkkinepajpigeijodppknjgdooef/)

然后这个文件夹成为扩展的根目录(在你的情况下,chrome-extension://ijkjkkkinepajpigeijodppknjgdooef/

So, if you declare popup.htmlas your, well, popup, Chrome will look for C:\Development\MyTestExtension\popup.html. Make sure this is exactly how that file is named: on Windows, file extensions are hidden by default and it's very easy to save a file as, say, popup.html.txtand not see the .txtpart.

因此,如果您声明popup.html为您的弹出窗口,Chrome 将查找C:\Development\MyTestExtension\popup.html. 确保这正是该文件的命名方式:在 Windows 上,默认情况下隐藏文件扩展名,并且很容易将文件另存为,例如,popup.html.txt看不到.txt零件。

As for a folder in the profile: it's only for packagedextensions that you download and install, not development unpackedversions.

至于配置文件中的文件夹:它仅用于您下载和安装的打包扩展,而不是开发打包版本。