且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Chrome扩展中有面板行为

更新时间:2023-12-05 21:57:46

我发现GTalk是面板的唯一扩展。您可以在自己的扩展中使用面板,使用真正的黑魔法:



在您的manifest.json中,添加键值对:



'pre> 键: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDsDApubb73tPfYlNIFxDu3K3 / EHgV6 / YOJXJkld1OZ20jW / cOht1j0NggnXhQYuu1mXFUufud4I2N7b5ydyg09gcM9Va3Zk17RhNV9smbPHOd4XlzJeXifX / 9MgHPu4FzCen3CiSXsOeAELJIXEuT28xICriuUko / rNPwGeIB9VwIDAQAB

和BOOM,面板激活!

这是Google激活隐藏功能的方式。 文档告诉我们关键的目的是提供独特的标识符,但我们并不需要它。如所证明的那样,它还激活隐藏的特征。

另外,你不能有两个具有相同键值的扩展名(GTalk被卸载)。我认为你的扩展可能不会让它进入Chrome商店。



如果你认识Google的某个人,请告诉他们,我们的凡人真的很想拥有面板。面板非常棒。它们是在网页顶部显示信息并同时与之互动的唯一方式。 Google应该分享这份爱,我们真的需要面板。

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)

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.