'chrome.app.runtime' and ' chrome.app.window' returns undefined in Chrome 23.0.1271.64 m

1,112 views
Skip to first unread message

簡煒航

unread,
Nov 9, 2012, 1:45:29 AM11/9/12
to chromi...@chromium.org
I developed an app using `chrome.app.window.create` to create an app window. It used to work, but now it not works suddenly (I didn't change any code.)

I opened background page console in `chrome://extensions` and run `chrome.app.window`:

>chrome.app.window
undefined
>chrome.app.isInstalled
false
>chrome.app.install()
"CRX-less web apps aren't enabled."
>chrome.app.runningState()
"cannot_run"

How to make my app work a again? Does it has something to do with permission setting?
Any idea?

Thanks for your reading. :)

Tony Jian

Renato Mangini

unread,
Nov 9, 2012, 1:41:52 PM11/9/12
to 簡煒航, chromi...@chromium.org

What version of Chrome? Can you send your manifest.json?

Thanks,


Renato Mangini | Chrome Developer Advocate | man...@google.com | +55 11 3797-1155



--
You received this message because you are subscribed to the Google Groups "Chromium Apps" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msg/chromium-apps/-/cXKTH7rSnfcJ.
To post to this group, send email to chromi...@chromium.org.
To unsubscribe from this group, send email to chromium-app...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-apps/?hl=en.

Message has been deleted

簡煒航

unread,
Nov 10, 2012, 8:39:22 AM11/10/12
to chromi...@chromium.org, 簡煒航
I have sent my manifest file to you. :)

I downloaded some sample chrome app codes, and it runs well, and the below is my part of my manifest file.

"app": {
    "launch": {
      "local_path": "app/index.html"
    }
  },
"background": {
    "scripts": ["background/background.js"],
    "persistent": false
  }

I guess Chrome determine my code as an extension instead of an app, that's why I can't access the api `chrome.app.window`. I have to add app background page in my manifest file to get access of `chrome.app.window` api.

But what if I want to launch my app window due to some user's event?

Take my TJDict for example, it's an English-Chinese dictionary extension, it contains non persistent background page, listening the event of user's double click to an English word, and then calls `chrome.app.window.create` to show the dictionary.

My extension has been installed about 1500 times, it used to work, but now useless. Is there any way to get it work again? I really don't want to make my users disappointed. OQ

How about something like this in manifest.json?
    "permissions": ["app.window"]

Ben Wells

unread,
Nov 11, 2012, 11:15:27 PM11/11/12
to 簡煒航, chromi...@chromium.org
Your manifest looks like that of an old-style packaged app, which would explain why you don't have chrome.app available. The new style packaged apps do not have a launch setting under the 'app' key, but they do have a background setting.



Renato Mangini

unread,
Nov 12, 2012, 11:29:50 AM11/12/12
to Ben Wells, 簡煒航, chromi...@chromium.org

Your feature of "double-click on an english word" seems more appropriate for an extension, and not a packaged app. Conceptually, an extension extends the browser with specific features. A packaged app, on the other hand, is a self-contained app and should not (and actually does not) have direct access to pages other than its own, as an extension does.


Renato Mangini | Chrome Developer Advocate | man...@google.com | +55 11 3797-1155



Reply all
Reply to author
Forward
0 new messages