firefox扩展状态栏覆盖运行

发布于 2024-10-10 08:25:15 字数 410 浏览 0 评论 0原文

我正在尝试制作我的第一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暗喜 2024-10-17 08:25:15

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文