9

When launching the Chrome Extension Google-Hangouts, a panel initially appears that lists members and a link/button to create a new Hangout.

This panel is initially pinned to the bottom right of the browser window. When pinned like this, it remains always on top as a browser navigation session continues: users can go to different URLs, change tabs, etc. and that panel stays at the bottom right and stays on top of all other windows (or at least on top of the main browser window).

Once it's unpinned, you can drag it around the window, but it no longer stays always on top.

My question is, how was that achieved - what code, or what functions, do i need to call to create that window/panel so that it stays initially pinned and always on top? Is there some binding to some native code that's involved? Some other approach?

If anyone know and can show or explain, i would be hugely grateful as this feature is key to an extension i'm trying to build.

Thanks a lot!

Lew
  • 1,431
  • 1
  • 16
  • 22
  • possible duplicate of [How to build an extension like Chat for Google](http://stackoverflow.com/questions/9487446/how-to-build-an-extension-like-chat-for-google) – Rob W May 26 '13 at 09:39
  • 1
    This does not work. I had already tried all variations of `type` - `panel`, `detached-panel`, and the others. I created an example windows-create call exactly as in the "possible duplicate" question. No joy. As soon as you click anywhere in Chrome, this window/panel disappears. Also, what does it mean when user "abraham" says that "panel may not be supported on all platforms"? Does it mean it may work on Windows 7 but no Windows XP? Or on Mac OS X 10.8.2 but not 10.7.x? Or does he mean that it'll work on older versions of Chrome but not newer ones? (I'm running Chrome 27). – Lew May 26 '13 at 14:59
  • 1
    Did you enable panels, either via `chrome://flags/` or `--enable-panels`? Copy-paste code from [this answer](http://stackoverflow.com/questions/13630789/detect-if-chrome-panels-are-enabled/13631643#13631643) and report back. – Rob W May 26 '13 at 15:08
  • 1
    OK, ignore my last comment. Doh! I didn't have the "Enable Panels" flag set in my `chrome://flags` setting. Soon as i enabled that, joy of joys, the panel works. Of course, the doc for `chrome.windows.create` does very cleary say that the popup appears "_unless the '--enable-panels' flag is set._" So, perhaps a clear lesson in RTFM! Rob W - thank you; you've been a consistently helpful source with all my questions, and i really appreciate your willingness to spend the time answering potentially dumb questions. Cheers to you! – Lew May 26 '13 at 15:11
  • So, the obvious follow-up question: Is there a way to enable panels in Chrome without the user having to type `chrome://flags` in the address bar and then finding that flag and clicking `enable`? Some programmatic way to flip the flag if panels are not enabled? – Lew May 26 '13 at 15:20
  • My above comment/question is posted because the Hangouts extension works just fine with my previous `Enable panels` flag not enabled. So they were able to somehow get around the fact that in my browser, this flag was NOT enabled - and yet the Hangouts panel still displayed as a proper always-on-top panel. Any idea on how they achieved that? Thanks again for your useful replies. – Lew May 26 '13 at 15:23
  • 1
    No. You can show instructions on enabling this feature. An alternative method, but extremely unlikely for common use is to [explicitly whitelist the extension in the Chromium source code](http://stackoverflow.com/questions/11614493/how-does-extension-chat-for-google-create-the-panel-window/11614605#11614605), as has been done with "Google Hangouts" (formerly called "Chat for Google"). Note: The feature is enabled by default on the Dev / Canary channel, so in the future, you don't have to ask any more. – Rob W May 26 '13 at 15:26
  • Got it. OK, thank you again for your help - appreciated! – Lew May 26 '13 at 16:23

2 Answers2

1

This may not be an answer but to get a clue of what is happening I extracted the crx file to view its content there are a few OS specific files : ace.dll , libace.so and ace. After researching a bit i found this. This is a plugin. Hangouts extension is using ace plugin which is actually running on your desktop(i'm not sure about this). You can check this article

Anunay Inuganti
  • 273
  • 1
  • 3
  • 14
  • Anunay, thanks for your response. I will look into this, but it makes sense that there's some other componentry running inside the OS that makes the magic happen. I've since gone on to do a different implementation, but this info will be useful in the future when we return to building a chrome version of our app. Thanks again! – Lew Nov 01 '13 at 03:44
1

I found this related post: How to build an chrome extension like Google Hangouts

ACE is actually not what makes the window, Chrome has that capability built in, apparently. Even if you don't enable panels, extensions from Google can still make them, provided your OS is capable.

Community
  • 1
  • 1
DankMemes
  • 2,085
  • 2
  • 21
  • 30