firefox扩展状态栏覆盖运行
我正在尝试制作我的第一个 Firefox 插件,但遇到了一些困难。
我已经为我想要的功能编写了 javascript 代码(window.alert("hello world!"))。我找到了在状态栏上制作东西的代码: https://developer.mozilla.org/en-US/docs/Archive/创建_a_status_bar_extention。现在,我想让用户可以单击状态栏部分,它将运行我的 hello world 警报。我花了3个小时寻找,但一无所获。
我怎样才能让我的状态栏运行我的javascript?
I am trying to make my first Firefox addon and am struggling a bit.
I have written the javascript code for what I want it to do (window.alert("hello world!")). I have found code to make a thing on the status bar:
https://developer.mozilla.org/en-US/docs/Archive/Creating_a_status_bar_extention. Now, I want to make it so that a user can click on the status bar part and it will run my hello world alert. I have spent 3 hours looking and have found nothing.
How can I make my status bar thing run my javascript?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
onclick
属性添加到您的 statusbarpanel 中,并包含您要调用的函数。然后确保该函数是在覆盖层中包含的脚本中定义的。Add an
onclick
attribute to your statusbarpanel, with the function you want to call. Then make sure the function is defined in a script which is included in your overlay.