I am building a Firefox extension which communicates with a web service. In my extension, I am required to change the extension icon in the toolbar based on the login status of the user. Is there a way for me to programmatically access the toolbar icon and then change the image for the toolbar icon?
Here is what extensions usually do in such scenario
.setAttribute
, e.g. .setAttribute("loggedin", "true")
. I recently answered a question about dealing with modifying toolbar buttons no matter if it is visible.#xulschoolhello-hello-world-button[loggedin="true"] { /* another icon */ }