简体   繁体   中英

firefox extension status bar overlay run

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM