1

I want to build a Chrome App to listen notifications sent by my Lab, and I don't want to open a Chrome window(just let the app run in background silently, and pop a box when I have a new message). But sockets api is only for packaged app, and packaged app has no background permission, what should I do? Thx.

2
  • What kind of notifications are you sending? chrome.pushMessaging and chrome.gcm (see developer.chrome.com/apps/gcm) receive notifications even if the app is not running. Commented Mar 11, 2014 at 20:14
  • Thx Dinh, our Lab doesn't connect to the Internet, so I guess GCM can't help me. Thx again. Commented Mar 12, 2014 at 4:28

1 Answer 1

0

(Quick answer, will edit later with more info.)

Chrome Packaged Apps don't need that permission, they have a background page by default. Most (say, 99% of existing) chrome apps will open a window when they launch, but thats optional.

If your app has an open window, the runtime will keep your application running an not move into an idle state. However, if you are using certain APIs, such as having an open TCP server socket listening for incoming connections, its very unlikely that the runtime will shut your app down unless the system is under serious constraints.

Sign up to request clarification or add additional context in comments.

4 Comments

Indeed, the app keeps alive when I launch it and keep Chrome open. However, I want it run when system setup, and still run even when I close Chrome window. Thx for reply.
How are you launching the application? On which platform? There is now a chrome app launcher directly integrated with desktop platforms and you should not need Chrome windows open to launch chrome apps. Starting chrome apps on system startup.. I'm not sure how to do.
They say they will support, but not now. code.google.com/p/chromium/issues/detail?id=163770
My own solution is to build an extension with background permission (just an empty extension do nothing, but make sure chrome runs in background all the time), and move the app shortcut to startup folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.