I am following the google chrome web app development on http://developer.chrome.com/trunk/apps/first_app.html and the web app is not launching. when i click on the app icon on the page it closes the tab. I have downloaded the sample apps and plugins from github but they too are not working when i look at the console i get this error, please not i have enabled experimental API's in chrome://flags.
Uncaught TypeError: Cannot read property 'onLaunched' of undefined
I have updated my chrome browser to version 22.0.1229.79. My manifest.json file is
{
"name": "Hello World!",
"description": "My first packaged app.",
"manifest_version": 2,
"version": "0.1",
"app": {
"background": {
"scripts": ["background.js"]
}
},
"icons": {
"16": "calculator-16.png",
"128": "calculator-128.png"
}
}
And my background.js file
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('window.html', {
'width': 400,
'height': 500
});
});
Can someone point me where am going wrong?
Go to Allow/block mode. Click Edit. For Play Store, choose what type of apps and extensions you want to let users install.
Android Runtime for Chrome (ARC) is a compatibility layer and sandboxing technology for running Android applications on desktop and laptop computers in an isolated environment. It allows applications to be safely run from a web browser, independent of user operating system, at near-native speeds.
Navigate to Devices > Chrome > Apps and Extensions. Select the "Block all other apps and extensions" option from the dropdown for the Allow or Block Apps and Extension field.
This error also occurs if you leave out the "app": {}
declaration in the manifest.json.
I.e. "background": { "scripts": [ "background.js" ] },
Will give this error.
And "app": { "background": { scripts": ["background.js"] },
will work properly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With