找不到chrome扩展清单文件

时间:2017-02-03 09:01:08

标签: javascript google-chrome google-chrome-extension

背景

我正在学习如何构建Chrome扩展应用,并且我按照this教程中的说明操作(您可以看到我的代码here)。

copy key to your manifest部分中的说明指出保持应用程序ID不变非常重要,为了做到这一点,他们必须复制已安装清单中的密钥.json到源清单。

说明声明此manifest.json文件必须存在于用户数据目录中,在我的情况下(mac):

~/Library/Application\ Support/Google/Chrome/Default/Extensions

与我的Chrome扩展应用ID对应的文件夹应显示在那里

问题

我无法在该目录中找到我的文件夹。如果没有将它们键入清单文件in the chrome identity example,那么我点击登录按钮,它只是打开一个新选项卡并提示用户输入他们的电子邮件/密码,然后是扩展名从来没有获得令牌。

我尝试了什么

我意识到目录中存在许多app id文件夹,但它们仅适用于我从google chrome webstore安装的应用程序(即谷歌文档等)..但不是我通过检查加载的任何应用程序开发人员模式复选框,然后单击加载解压扩展.. 按钮。

考虑一下(我的应用程序是文档化的,教程应用程序是身份api样本):

enter image description here

如果我去

~/Library/Application Support/Google/Chrome

并搜索包含我的应用的ID:

的文件夹
find . | grep cmfbnommmmeccnkbochkfakncgnebckn

我得到了

3521:./Default/IndexedDB/chrome-extension_cmfbnommmmeccnkbochkfakncgnebckn_0.indexeddb.leveldb
3522:./Default/IndexedDB/chrome-extension_cmfbnommmmeccnkbochkfakncgnebckn_0.indexeddb.leveldb/000003.log
3523:./Default/IndexedDB/chrome-extension_cmfbnommmmeccnkbochkfakncgnebckn_0.indexeddb.leveldb/CURRENT
3524:./Default/IndexedDB/chrome-extension_cmfbnommmmeccnkbochkfakncgnebckn_0.indexeddb.leveldb/LOCK
3525:./Default/IndexedDB/chrome-extension_cmfbnommmmeccnkbochkfakncgnebckn_0.indexeddb.leveldb/LOG
3526:./Default/IndexedDB/chrome-extension_cmfbnommmmeccnkbochkfakncgnebckn_0.indexeddb.leveldb/LOG.old
3527:./Default/IndexedDB/chrome-extension_cmfbnommmmeccnkbochkfakncgnebckn_0.indexeddb.leveldb/MANIFEST-000001
7747:./Profile 1/Storage/ext/cmfbnommmmeccnkbochkfakncgnebckn
7748:./Profile 1/Storage/ext/cmfbnommmmeccnkbochkfakncgnebckn/def
7749:./Profile 1/Storage/ext/cmfbnommmmeccnkbochkfakncgnebckn/def/GPUCache
7750:./Profile 1/Storage/ext/cmfbnommmmeccnkbochkfakncgnebckn/def/GPUCache/data_0
7751:./Profile 1/Storage/ext/cmfbnommmmeccnkbochkfakncgnebckn/def/GPUCache/data_1
7752:./Profile 1/Storage/ext/cmfbnommmmeccnkbochkfakncgnebckn/def/GPUCache/data_2
7753:./Profile 1/Storage/ext/cmfbnommmmeccnkbochkfakncgnebckn/def/GPUCache/data_3
7754:./Profile 1/Storage/ext/cmfbnommmmeccnkbochkfakncgnebckn/def/GPUCache/index
7793:./Profile 1/Web Applications/_crx_cmfbnommmmeccnkbochkfakncgnebckn
7794:./Profile 1/Web Applications/_crx_cmfbnommmmeccnkbochkfakncgnebckn/Profile 1 cmfbnommmmeccnkbochkfakncgnebckn.app
7795:./Profile 1/Web Applications/_crx_cmfbnommmmeccnkbochkfakncgnebckn/Profile 1 cmfbnommmmeccnkbochkfakncgnebckn.app/Contents
7796:./Profile 1/Web Applications/_crx_cmfbnommmmeccnkbochkfakncgnebckn/Profile 1 cmfbnommmmeccnkbochkfakncgnebckn.app/Contents/Info.plist
7797:./Profile 1/Web Applications/_crx_cmfbnommmmeccnkbochkfakncgnebckn/Profile 1 cmfbnommmmeccnkbochkfakncgnebckn.app/Contents/MacOS
7798:./Profile 1/Web Applications/_crx_cmfbnommmmeccnkbochkfakncgnebckn/Profile 1 cmfbnommmmeccnkbochkfakncgnebckn.app/Contents/MacOS/app_mode_loader
7799:./Profile 1/Web Applications/_crx_cmfbnommmmeccnkbochkfakncgnebckn/Profile 1 cmfbnommmmeccnkbochkfakncgnebckn.app/Contents/PkgInfo
7800:./Profile 1/Web Applications/_crx_cmfbnommmmeccnkbochkfakncgnebckn/Profile 1 cmfbnommmmeccnkbochkfakncgnebckn.app/Contents/Resources
7801:./Profile 1/Web Applications/_crx_cmfbnommmmeccnkbochkfakncgnebckn/Profile 1 cmfbnommmmeccnkbochkfakncgnebckn.app/Contents/Resources/app.icns
7802:./Profile 1/Web Applications/_crx_cmfbnommmmeccnkbochkfakncgnebckn/Profile 1 cmfbnommmmeccnkbochkfakncgnebckn.app/Contents/Resources/en-US.lproj
7803:./Profile 1/Web Applications/_crx_cmfbnommmmeccnkbochkfakncgnebckn/Profile 1 cmfbnommmmeccnkbochkfakncgnebckn.app/Contents/Resources/en-US.lproj/InfoPlist.strings
9484:./Profile 2/IndexedDB/chrome-extension_cmfbnommmmeccnkbochkfakncgnebckn_0.indexeddb.leveldb
9485:./Profile 2/IndexedDB/chrome-extension_cmfbnommmmeccnkbochkfakncgnebckn_0.indexeddb.leveldb/000003.log
9486:./Profile 2/IndexedDB/chrome-extension_cmfbnommmmeccnkbochkfakncgnebckn_0.indexeddb.leveldb/CURRENT
9487:./Profile 2/IndexedDB/chrome-extension_cmfbnommmmeccnkbochkfakncgnebckn_0.indexeddb.leveldb/LOCK
9488:./Profile 2/IndexedDB/chrome-extension_cmfbnommmmeccnkbochkfakncgnebckn_0.indexeddb.leveldb/LOG
9489:./Profile 2/IndexedDB/chrome-extension_cmfbnommmmeccnkbochkfakncgnebckn_0.indexeddb.leveldb/MANIFEST-000001
10348:./Profile 2/Storage/ext/cmfbnommmmeccnkbochkfakncgnebckn
10349:./Profile 2/Storage/ext/cmfbnommmmeccnkbochkfakncgnebckn/def
10350:./Profile 2/Storage/ext/cmfbnommmmeccnkbochkfakncgnebckn/def/GPUCache
10351:./Profile 2/Storage/ext/cmfbnommmmeccnkbochkfakncgnebckn/def/GPUCache/data_0
10352:./Profile 2/Storage/ext/cmfbnommmmeccnkbochkfakncgnebckn/def/GPUCache/data_1
10353:./Profile 2/Storage/ext/cmfbnommmmeccnkbochkfakncgnebckn/def/GPUCache/data_2
10354:./Profile 2/Storage/ext/cmfbnommmmeccnkbochkfakncgnebckn/def/GPUCache/data_3
10355:./Profile 2/Storage/ext/cmfbnommmmeccnkbochkfakncgnebckn/def/GPUCache/index

所以没有任何文件夹出现在教程指示的Default/Extensions目录中。

如果我搜索google drive的应用ID(lmjegmlicamnimmfhcmpkclmigmmcbeh),我会在Default/Extensions

中找到该文件夹
2572:./Default/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh
2573:./Default/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0
2574:./Default/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/_metadata
2575:./Default/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/_metadata/computed_hashes.json
2576:./Default/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/_metadata/verified_contents.json
2577:./Default/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/background.js
2578:./Default/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/images
2579:./Default/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/images/drive-sync16.png
2580:./Default/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/images/drive-sync256.png
2581:./Default/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/images/drive-sync64.png
2582:./Default/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/manifest.json
5092:./External Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh.json
6552:./Profile 1/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh
6553:./Profile 1/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0
6554:./Profile 1/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/_metadata
6555:./Profile 1/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/_metadata/computed_hashes.json
6556:./Profile 1/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/_metadata/verified_contents.json
6557:./Profile 1/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/background.js
6558:./Profile 1/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/images
6559:./Profile 1/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/images/drive-sync16.png
6560:./Profile 1/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/images/drive-sync256.png
6561:./Profile 1/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/images/drive-sync64.png
6562:./Profile 1/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/manifest.json
9027:./Profile 2/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh
9028:./Profile 2/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0
9029:./Profile 2/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/_metadata
9030:./Profile 2/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/_metadata/computed_hashes.json
9031:./Profile 2/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/_metadata/verified_contents.json
9032:./Profile 2/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/background.js
9033:./Profile 2/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/images
9034:./Profile 2/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/images/drive-sync16.png
9035:./Profile 2/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/images/drive-sync256.png
9036:./Profile 2/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/images/drive-sync64.png
9037:./Profile 2/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/manifest.json
11067:./Profile 3/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh
11068:./Profile 3/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0
11069:./Profile 3/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/_metadata
11070:./Profile 3/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/_metadata/computed_hashes.json
11071:./Profile 3/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/_metadata/verified_contents.json
11072:./Profile 3/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/background.js
11073:./Profile 3/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/images
11074:./Profile 3/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/images/drive-sync16.png
11075:./Profile 3/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/images/drive-sync256.png
11076:./Profile 3/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/images/drive-sync64.png
11077:./Profile 3/Extensions/lmjegmlicamnimmfhcmpkclmigmmcbeh/3.2_0/manifest.json

有趣的是,在我安装的应用的任何目录中都找不到manifest.json。请考虑一下:

~/Library/Application Support/Google/Chrome$ find . grep manifest.json | grep cmfbnommmmeccnkbochkfakncgnebckn

什么都不返回!

想法?

1 个答案:

答案 0 :(得分:-1)

在处理解压缩版本时,您可以跳过将密钥添加到清单文件的步骤,但请务必将oAuth密钥添加到清单文件中,并在为oAuth创建凭据时使用扩展密钥。

您可以在不将其上传到网上商店的情况下测试您的扩展程序。