cannot find chrome extension manifest file

自古美人都是妖i 提交于 2019-12-25 08:49:23

问题


background

I'm learning how to build a chrome extension app, and I'm following the instructions in this tutorial (you can see my code here).

The instructions in the copy key to your manifest section states that it's important to keep their application id constant and in order to do that, they must copy the key in the installed manifest.json to the source manifest.

The instructions state that this manifest.json file must exist in the user data directory, in my case (mac):

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

a folder corresponding to my chrome extension app id should show up there

problem

I couldn't find my folder in that directory. By failing to include they key in the manifest file as they did in the chrome identity example then evey time I click on the sign in button, it simply opens a new tab and prompts the user to enter their email/password, but then the extension never gets the token.

what I have tried

I realized that there are many app id folders that exist on the said directory, but they are only for the apps I installed from google chrome webstore (ie google docs etc).. but not any of the apps I loaded by checking the developer mode checkbox then clicking on the Load unpacked extension.. button.

consider this (my app is documentivly, and the tutorial app is identity api sample):

If I go to

~/Library/Application Support/Google/Chrome

and search for the folder containing my app's id:

find . | grep cmfbnommmmeccnkbochkfakncgnebckn

I get

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

so none of the folders appear in the Default/Extensions directory as instructed by the tutorial.

If I search for the app id of google drive (lmjegmlicamnimmfhcmpkclmigmmcbeh), I find the folder in the 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

What's interesting is that there is no manifest.json to be found anywhere in any of the directories of my installed app.. consider this:

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

returns nothing!

ideas?


回答1:


While working on unpacked version you can skip the step for adding the key to your manifest file, but be sure to add the oAuth key to the manifest file and also use the extension key while creating Credentials for the oAuth.

You can test your extension without uploading it on a webstore.



来源:https://stackoverflow.com/questions/42020384/cannot-find-chrome-extension-manifest-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!