I have a Safari browser extension with a disabled mode. What I'd like to do is to programmatically change the toolbar icon when the user enters disabled mode.

Is there an API which will allow me to achieve this and if so what is it?