Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assign tray icon to Google Chrome web application

I need to create a web application which will be stored in the traybar of Windows, this to prevent users from accidentally close my application (without the need of a pre-close alert message).

I thought that Google Chrome's background apps could be the right way to go, mostly because I don't need cross-browser compatibility and I have to choose which browser my users will use to run this web application.

The only problem is that I don't understand if I can achieve what I need with this feature.

I've found only this example of background app in Chrome countdown app But this app uses the "background page" feature, that is different from what I'm looking for.

How can I let a Chrome app be minimized in the traybar (or even in the taskbar would be ok) instead of be closed?

like image 831
Fez Vrasta Avatar asked Jan 28 '14 11:01

Fez Vrasta


2 Answers

Try to use node-webkit (chromium + node.js) for it: https://github.com/rogerwang/node-webkit

It allow to create any web-app and it support tray icons: https://github.com/rogerwang/node-webkit/wiki/Tray

You can download my windows example app here: https://mega.co.nz/#!xQMzgbxD!S58G-V23QLNRDFC10xso41-T2V8OZQVsQEH-lr46R3s

If you want exactly chrome, try this NPAPI plugin example: http://minimizetotray.googlecode.com/files/SourceCode.zip from http://habrahabr.ru/post/73003/

like image 175
VoidVolker Avatar answered Oct 20 '22 19:10

VoidVolker


Unfortunately, I don't think you will be able to achieve exactly what you're after. You might be able to combine the two solutions below to nearly achieve your requirements. However, I don't think the type of control you are after is available via Google Apps.

Google App Launcher

The Google App Launcher would fulfill the "stored in the traybar of Windows" requirement.

The Chrome App Launcher is the hub of all your Chrome apps and with it you have quick access to all of your apps from the desktop. When you install an app from the "For Your Desktop" collection of the Chrome Web Store, you get the App Launcher. The App Launcher requires you to sign in to Chrome to enable apps that need access to your Google account.

Google App Launcher

Manage apps

When you download a new app that enables App Launcher, the apps from your Apps bookmark on Chrome New Tab page will also appear in the App Launcher. Managing apps in the App Launcher is simple.

  • Add more apps: Click the Chrome Web Store button Chrome Web Store button in your apps list and explore the apps in the store.

  • ...

Background: Extending Your App's Life

You mentioned background apps in your question but I would recommend you explore it further. It essentially provides the "prevent users from accidentally close my application" requirement that you stated. This isn't foolproof (see bold sentence below) but it is about as close to the requirement I think you will be able to achieve.

As of Google Chrome 10, the background feature lets a hosted app run as soon as the user logs into their computer—before the user launches Chrome or the app—and to continue running even when Chrome or the app has no visible windows. However, if the user explicitly quits Chrome, the browser and app both exit.

like image 1
JSuar Avatar answered Oct 20 '22 19:10

JSuar