Variables in manifest.json

1,418 views
Skip to first unread message

CqN on cr-48 devchannel 0.12.397.0

unread,
Apr 29, 2011, 11:07:56 AM4/29/11
to Chromium-extensions
Can data defined outside of the manifest file be used in the
manifest? Or the manifest's name string be retrieved from a
javascript? What I would like to do: is to have a common version
info (ideally updated in my main javascript) to be used everywhere,
including the manifest. The manifest's name string shows up in the
extension manager tab. It would be nice if the same info can be used
everywhere else. Manifest is seldom updated, but the version in the
main file is updated often (with every change, say). It would be very
nice to have the version info only one place.

Can anything like this be currently accomplished? Even if it needs to
use a js function, it is worth it to me to have the version auto
available everywhere.

CqN

Arne Roomann-Kurrik

unread,
Apr 29, 2011, 1:16:11 PM4/29/11
to CqN on cr-48 devchannel 0.12.397.0, Chromium-extensions
You can fetch the manifest using XMLHttpRequest and decode it using JSON.parse.  I've written a sample to do so which you can see here:

~Arne



--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.


CqN on cr-48 devchannel 0.12.397.0

unread,
Apr 29, 2011, 2:32:16 PM4/29/11
to Chromium-extensions
Thanks, Arne.

Alternatively, in my simpler case, the version can be in a locale
messages files, ad then it can be accessed by manfest, css and js
files.

CqN

On Apr 29, 10:16 am, Arne Roomann-Kurrik <kur...@chromium.org> wrote:
> You can fetch the manifest using XMLHttpRequest and decode it using
> JSON.parse.  I've written a sample to do so which you can see here:https://github.com/kurrik/chrome-extensions/tree/master/xhr-manifest
>
> ~Arne
>
> On Fri, Apr 29, 2011 at 8:07 AM, CqN on cr-48 devchannel 0.12.397.0 <
>
>
>
>
>
>
>
> chackoner...@gmail.com> wrote:
> > Can data defined outside of the manifest file be used in the
> > manifest?  Or the manifest's name string be retrieved from a
> > javascript?  What I would like to do:  is to have a common version
> > info  (ideally updated in my main javascript) to be used everywhere,
> > including the manifest.  The manifest's name string shows up in the
> > extension manager tab.  It would be nice if the same info can be used
> > everywhere else.  Manifest is seldom updated, but the version in the
> > main file is updated often (with every change, say).  It would be very
> > nice to have the version info only one place.
>
> > Can anything like this be currently accomplished?  Even if it needs to
> > use a js function, it is worth it to me to have the version auto
> > available everywhere.
>
> > CqN
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org.

Arne Roomann-Kurrik

unread,
Apr 29, 2011, 7:45:19 PM4/29/11
to CqN on cr-48 devchannel 0.12.397.0, Chromium-extensions
Cool, let us know if you find a general-purpose solution that which works for you.

~Arne


To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
Reply all
Reply to author
Forward
0 new messages