安装 Firefox 扩展后打开页面
我正在尝试做类似于这篇文章的事情。但是,我正在使用附加 SDK,但似乎找不到方法来执行此操作。
在用户安装我的附加组件后,我应该将用于打开页面的代码放在哪里?
另外,我想知道是否有一种方法可以在安装后切换附加栏,并在安装后在附加小部件顶部显示一个面板,就像 Chrome 在安装扩展后所做的那样。
I am trying to do something similar to this post. However, I am using the Add-on SDK and I can't seem to find a way to do this.
Where would I put the code to open the page right after the user has installed my add-on?
Also, I would like to know if there is a way to toggle the add-on bar after installation, and show a panel on top of my add-on widget after installation like Chrome does it after you install an extension.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这并不明显,但您可以附加在加载或卸载扩展时调用的函数。文档中的“简单扩展教程”对此进行了介绍:
https ://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Listening_for_load_and_unload
我认为要在一个模块,你可以做类似的事情:
It isn't obvious, but you can attach functions that get called when the extensions is loaded or unloaded. This is covered in the 'simple extension tutorial' in the docs:
https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Listening_for_load_and_unload
I think to implement this in a module you could do something like: