开发者

firefox extension status bar overlay run

开发者 https://www.devze.com 2023-02-02 03:31 出处:网络
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 c

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消