Stan Angeloff’s blog

Styling XUL applications like web pages August 13, 2010

If you don’t know of XUL applications there are many out there in the wild. You are probably using a Mozilla XUL-based app without even realising it.

I am a Komodo Edit user myself and I love the platform. I have posted several extensions if my words are not enough to prove it.

The greatest weakness of XUL apps in my book is how static they feel. They are not as dynamic and rich as HTML documents and as a result development is usually not as easy and elegant. You are forced to restart the application between updates or rely on hacky methods to reload it while running. Being frustrated with these facts, I decided to do something about it. It would be wonderful if you could just press Ctrl+Alt+R and have a fresh stylesheet loaded into your application – much like existing solutions for Google Chrome of Firefox. Here is one way you can do just this in Komodo:

Create this as a macro and assign a key binding to it. Pressing it will discard any previously loaded stylesheet and inject a non-cached fresh copy of it right in the beginning of the document.

This can be simulated in any XUL app – you would need a keypress handler and some code to deal with recognising the correct combination of keys and you are off on a good start.

comments powered by Disqus