最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Having panel behavior in chrome extension - Stack Overflow

programmeradmin4浏览0评论

I need to have panel behavior in chrome: something always on top but that does not impair the navigation (in any other way than masking a few pixels).

We have two options at the moment:

  • window in panel mode: not available yet (although it is available now to the GTalk extension).

  • window in popup mode: I can make it be always on top by refocusing at every event, however the focus will get targeted at my window (and impair the navigation)

I'm looking for either:

  • GTalk's dark magic

  • A way to make a popup window stay on top (or e on top and relinquish the focus to the second topmost window)

I need to have panel behavior in chrome: something always on top but that does not impair the navigation (in any other way than masking a few pixels).

We have two options at the moment:

  • window in panel mode: not available yet (although it is available now to the GTalk extension).

  • window in popup mode: I can make it be always on top by refocusing at every event, however the focus will get targeted at my window (and impair the navigation)

I'm looking for either:

  • GTalk's dark magic

  • A way to make a popup window stay on top (or e on top and relinquish the focus to the second topmost window)

Share Improve this question asked Mar 19, 2012 at 21:17 BenoitParisBenoitParis 3,1844 gold badges34 silver badges58 bronze badges 6
  • I too need this source. You can install and debug the extension but the JS is rather obfuscated. chrome.google./webstore/detail/… – mcqwerty Commented Mar 20, 2012 at 19:56
  • @mcqwerty Well, I did some reverse engineering (unzip, jsbeautifier the js, load as unpackaged extension, set breakpoints around window creation)... And they use "type": "panel", but I just don't know how they get it to work. Maybe they hard-coded something in Chrome to let them have features in advance. We mortals will have to wait. – BenoitParis Commented Mar 21, 2012 at 13:02
  • I don't think you can acplish what you want. I tried the extension you mention and the focus doesn't remain in the main window. Why do you think gtalk has acplished that? Can you be more specific? – Ernest Commented Mar 28, 2012 at 17:24
  • @Ernest Gtalk relinquishes focus while still remaining on top of all other windows. That's what we're trying to reproduce. BenoitParis is pointing out that one can bring the window to the top by repeatedly stealing focus back, but that obviously is a cure worse than the disease. Thanks! – mcqwerty Commented Mar 28, 2012 at 19:26
  • Maybe the desktop notification api is something for you code.google./chrome/extensions/notifications.html – Oliver Commented Jun 7, 2012 at 3:04
 |  Show 1 more ment

1 Answer 1

Reset to default 9

I found how GTalk is the only extension with panels. You can have panels too in your own extension, using really dark magic:

In your manifest.json, add the key-value pair:

"key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDsDApubb73tPfYlNIFxDu3K3/EHgV6/YOJXJkld1OZ20jW/cOht1j0NggnXhQYuu1mXFUufud4I2N7b5ydyg09gcM9Va3Zk17RhNV9smbPHOd4XlzJeXifX/9MgHPu4FzCen3CiSXsOeAELJIXEuT28xICriuUko/rNPwGeIB9VwIDAQAB"

And BOOM, panels activated!

This is Google's way of activating a hidden feature. The documentation tells us "key"'s purpose is to provide a unique identifier but that we don't really need it. As demonstrated, it also activates hidden features.

Also, you cannot have two extensions with the same "key" value (GTalk gets uninstalled). And I think your extension might not make it to the chrome store.

If you know someone at Google, please tell them we mortals would really really love to have panels too. Panels are awesome. And they are the only way to display information on top of a web page while still interacting with it. Google should share the love, we really need panels.

发布评论

评论列表(0)

  1. 暂无评论