Google Chrome error "onLaunched" in the plugin

I am following the development of the google chrome web application at http://developer.chrome.com/trunk/apps/first_app.html and the web application does not start. when I click on the application icon on the page, it closes the tab. I downloaded sample applications and plugins from github, but they also do not work, when I look at the console, I get this error, please, I did not include the experimental API in chrome: // flags.

Uncaught TypeError: Cannot read property 'onLaunched' of undefined 

I updated my Chrome browser to version 22.0.1229.79. My manifest.json file

{
"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 you are wrong?

+5
source share
4 answers

dev/beta Chrome, 23.

manifest.json,

{
  ...,
  "minimum_chrome_version": "23",
  ...
}
+2

, "app": {} manifest.json.

.. "background": { "scripts": [ "background.js" ] }, .

"app": { "background": { scripts": ["background.js"] }, .

+7

( background app ) Chrome 23 ( dev-, -) .

+3

.

+1

All Articles