Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read the version from manifest.json [duplicate]

Is there a way for a Chrome extension to read properties from manifest.json? I'd like to be able to read the version number and use it in the extension.

like image 280
Ben McCann Avatar asked Jan 03 '13 23:01

Ben McCann


People also ask

How do I view manifest JSON?

First check if manifest. json is applied in the browser. For that open developer window by pressing shortcut F12. In Application tab, click Manifest option and see if it displays information that you have set.

What is the manifest version?

One to four dot-separated integers identifying the version of this extension. A couple of rules apply to the integers: they must be between 0 and 65535, inclusive, and non-zero integers can't start with 0. For example, 99999 and 032 are both invalid.

What is manifest JSON in Chrome extension?

The manifest. json file contains information that defines the extension. The format of the information in the file is JSON. You can read more about what it contains in Google Chrome developer documentation: Manifest File Format. You will probably also want to read: Overview of Google Chrome Extensions.

How do I check my Chrome manifest extension?

You can just use chrome. runtime. getManifest() to access the manifest data - you don't need to GET it and parse it.


2 Answers

You can just use chrome.runtime.getManifest() to access the manifest data - you don't need to GET it and parse it.

var manifestData = chrome.runtime.getManifest(); console.log(manifestData.version); console.log(manifestData.default_locale); 
like image 68
nfm Avatar answered Sep 16 '22 16:09

nfm


The snipet chrome.app.getDetails() is not working anymore, is returning an error:

TypeError: Object # has no method 'getDetails'

You want to use chrome.runtime.getManifest() instead.

like image 37
Ondrej Avatar answered Sep 20 '22 16:09

Ondrej