I have an extension and a packaged app which need to talk to each other, and need to know each others extension IDs to do so.
In production the extension IDs can be hard-coded - no problem here.
Ideally, it would be great to be able to hard-code the IDs in development too.
It seems that the IDs change when the unpacked extension is installed in different browsers. With multiple developers using multiple browsers (Canary + Standard), this makes hard-coding impractical (if they IDs cannot be locked down somehow).
I have found instructions here about how to keep IDs consistent in development, using the key field in an installed app’s manifest.json:
To keep your application ID constant, you need to copy the key in the installed manifest.json to your source manifest. It’s not the most graceful task, but here’s how it goes:
- Go to your user data directory. Example on MacOs: ~/Library/Application\ Support/Google/Chrome/Default/Extensions
- List the installed apps and extensions and match your app ID on the apps and extensions management page to the same ID here.
- Go to the installed app directory (this will be a version within the app ID). Open the installed manifest.json (pico is a quick way to open the file).
- Copy the “key” in the installed manifest.json and paste it into your app’s source manifest file.
The problem I have here is that I am using unpacked extensions which do not set a key field in the manifest.json (I am running OSX).
Current workaround
The extension can use the chrome.management api to search for the name or short name of the Chrome app - no problem here.
The app though cannot access the chrome.management api because it is disabled by Chrome. Only solution I can think of is to send a message from the extension to the app to let it know - but this seems buggy. I am just hard-coding at the moment.
---
Any suggestions would be helpful.
Cheers!
Fixed Key and id's are for packaged extensions . You must package your extension once. .you will get a crx file. Load it in the browser and then follow your steps below to get the key.put this key in your unpacked manifest.json and you will have a fixed ex extension Id .
Sent from LG
--
You received this message because you are subscribed to the Google Groups "Chromium Apps" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-app...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-apps/.
For more options, visit https://groups.google.com/a/chromium.org/groups/opt_out.