Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having panel behavior in chrome extension

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 come on top and relinquish the focus to the second topmost window)

like image 227
BenoitParis Avatar asked Mar 19 '12 21:03

BenoitParis


People also ask

How do I add developer tools to Chrome extensions?

Use the chrome. devtools. panels API to integrate your extension into Developer Tools window UI: create your own panels, access existing panels, and add sidebars.

Can Chrome Extensions talk to each other?

In addition to sending messages between different components in your extension, you can use the messaging API to communicate with other extensions.


1 Answers

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.

like image 143
BenoitParis Avatar answered Oct 02 '22 16:10

BenoitParis