I\'m building a Chrome Packaged App. I want to put the script configuration if a config file in a resource directory and on startup want to read that by Javascript.
You can use messageResource.js, a simple javascript library created by me for loading properties file.
1) Include messageResource.js in your index.html.
2) You can get key-value pairs of config.properties from main.js using the following code.
// initialize messageResource.js
messageResource.init({
// path to directory containing config.properties
filePath : 'resource'
});
// load config.properties file
messageResource.load('config', function(){
// load file callback
// get value corresponding to a key from config.properties
var value = messageResource.get('key', 'config');
});