If you're going to fiddle with this - it might be nice to move the
isVanilla logic into chrome-common


On Thu, Aug 15, 2013 at 1:22 PM, Ian Clelland <notifications@github.com>wrote:

> In plugins/chrome-runtime/api/runtime.js:
>
> > @@ -81,8 +82,22 @@ exports.reload = function() {
> >    location.reload();
> >  };
> >
> > -exports.__defineGetter__("id", function(){
> > -  return exports.getManifest()['key'];
> > +var appIdCache = Object.create(null);
> > +exports.__defineGetter__("id", function() {
> > +  var isVanilla = true;
> > +  try {
> > +    require('org.chromium.chrome-bootstrap.bootstrap');
> > +    isVanilla = false;
> > +  } catch (e) {}
> > +  if (isVanilla)
> > +    return  exports.getManifest()['name']; // TODO: use qualified name given during cordova project creation instead (?)
>
> Could you return this value in the catch() clause? Then we wouldn't need
> the boolean isVanilla at all
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/MobileChromeApps/chrome-cordova/pull/32/files#r5794557>
> .
>