By reading http://developer.chrome.com/extensions/management.html I get the impression if I add to my permissions manifest thusly:
... "permissions": ["webRequest", "storage", "", "management"], ...
I should now be able to do something like this:
if(chrome.management.get('installType') == "development") {
DEVELOPMENT = true;
}
but the error message I receive,
Error during management.get: Failed to find extension with id installType
leads me to think it REALLY wants an app id like:
chrome.runtime.id
but the signature is pretty clear that that is not the case:
Error: Invocation of form management.get(string, string) doesn't match definition management.get(string id, optional function callback)
So my underlying question is: How do I do this neatly such that I can set a flag if I am in an unpacked (and therefore, me developing) mode and do additional stuff that will not be required when it's in the extension store (in my case, change a web service endpoint)?
I couldn't find a bunch of examples with management.get, so I'm thinking the either the invocation of .get I have above is flawed, my permissions are not correct, and/or the error message on .get is cut and paste from getAll : )
Let me know how I can clarify this, I've been bashing my head for an hour and probably could use some leading questions ; )
The installType property is part of the ExtensionInfo structure, so when you get your extension using get() or getAll() this property should be set for it.