I have 2 JavasScript files for my Chrome Packaged App.
1. background.js is a main JavaScript file that called by manifest.json
var foo = 'sss';
function bar(a,b) {
return a+b;
}
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('index.html', {
bounds: {
width: 500,
height: 300
}
});
});
2. app.js is a controller of index.html
Question: Can I call variable "foo" or function "bar" from background.js in app.js?
PS. Or have any solution to transfer value between page such as chrome.storage ?