How to add UI elements from a bootstraped Firefox addon

a 夏天 提交于 2019-12-04 18:48:15

It's not easy right now. You need to keep track of browser windows as they open and close and add your UI to each window manually via DOM APIs

See how it's implemented in the Addon (formerly Jetpack) SDK: https://github.com/mozilla/addon-sdk/blob/master/packages/addon-kit/lib/widget.js#L215 (browserManager, in case the line numbers change).

The Mozilla Add-on SDK which is also known as JetPack has evolved to the point where it can be used to create entire add-ons. Not only are the add-ons fast and simple to create, but they are also restartless.

The best way to add UI elements with the SDK is to use the Widget API which will easily allow you to add an icon to the status bar. There are also other APIs for the context-menu and creating panels.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!