7

I'm trying to create a Chrome package App with an icon in the system menu bar as explain here : https://docs.google.com/document/d/1QhhfR33Y28Yqnnoa_Sl3fnZK_mKtwt4dZe6kNyJ_MjU/edit ,

The Google Hangout App can implement this feature (it's not exactly the same behavior) but I don't find any good documentation to do the same.

In the manifest page of Google Packaged App, we can see the field "system_indicator". Is it what I'm looking for ? When I try to set this field to an url of an icon, Chrome return me this error :

'system_indicator' requires Google Chrome dev channel or newer, but this is the beta channel.

I've also found this old page from the chromium project : http://www.chromium.org/developers/design-documents/extensions/proposed-changes/apis-under-development/system-indicator-api

So my question is simple : can I build this feature for my app ? And if yes, how ?

Thank you for your help ! :-)

Guillaume Wuip
  • 343
  • 5
  • 13

2 Answers2

4

The system_indicator was an experimental API partly introduced in the dev channel, but was later removed, as the Chrome/Chromium team deemed it too costly to maintain across all platforms. The entire history of this API is available at issue 142450.

In other words, as for now, there is no API for a system tray icon.

Denilson Sá Maia
  • 47,466
  • 33
  • 109
  • 111
  • I'm curious about this as well, given some time has passed since this original thread I wonder if there's a place to find more info. I ask because the current hangouts app clearly has a status icon (on OSX) when using the stable channel build of Chrome (https://chrome.google.com/webstore/detail/google-hangouts/nckgahadagoaajjgafhacjanaoiihapd?hl=de). Yet when I attempt to invoke ```system_indicator``` in my manifest (the same as the hangouts extension) I get an error. Any tips as to how this could be? – frederickk Oct 22 '16 at 01:52
  • Regarding the Hangouts extension: it either uses native binary code to add the icon there, or it uses an API that is not publicly available. [Hangouts was whitelisted to use an API that was not available for any other extension](https://stackoverflow.com/questions/27804315/), so maybe the same happens with this API. – Denilson Sá Maia Oct 23 '16 at 18:47
  • 1
    I reached out to a contact on the Chrome extensions team and indeed you're correct. The Hangouts extension is whitelisted for unique access to the ```system_indicator``` API. – frederickk Oct 24 '16 at 15:43
3

The hangouts app uses a "panel" type window to achieve its behaviour, see Abraham's answer on How to build an chrome extension like Google Hangouts. Essentially, when you open a window, add type="panel" parameter:

chrome.windows.create({ url: 'https://mobile.twitter.com/', type: 'panel' });

Regarding the error you mentioned, this is because you are using the Beta Chrome build, and it has realised that the feature is not available in this version, and is advising you that you need a dev channel or trunk release. Find out more about Chrome release channels here: http://www.chromium.org/getting-involved/dev-channel

Community
  • 1
  • 1
Chris Alexander
  • 1,212
  • 14
  • 19
  • Ok, thank you ! It seems to work for an extension :-) Is it possible to do the same for an Packaged App ? I've found this [old doc for Packaged App](http://developer.chrome.com/extensions/apps.html) that uses the term "panel" in the manifest. I'm french an I don"t understand if it will be the same as for extension. – Guillaume Wuip Dec 01 '13 at 19:13
  • And so what is what the filed "system_indicator". I don't find any doc for it. – Guillaume Wuip Dec 01 '13 at 19:54
  • 1
    "system_indicator" is exactly what you think and need. However, it's been in a state of flux since last January: see the corresponding [Chrome bug](https://code.google.com/p/chromium/issues/detail?id=142450). It needs to be revived. If you're willing to try it out in the meantime, though, you can find 2 very basic examples [here](https://code.google.com/p/chromium/codesearch#chromium/src/chrome/test/data/extensions/api_test/system_indicator/). – Sergey Shevchenko Dec 02 '13 at 08:15
  • A lot of thank ! I've run the examples and it works. It would be great that the chromium team write an doc about it for futur needs :-) – Guillaume Wuip Dec 03 '13 at 20:51
  • yeah! "system_indicator" is not yet supported as this time as well. Hopefully, they'll support it.. – paolooo Apr 24 '14 at 16:24