It's actually pretty simple, but many small things can go wrong. So, here is your small boilerplate code for a XUL overlay which renders a small canvas area in the status bar:
<?xml version="1.0"?> <overlay id="myOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> <statusbar id="status-bar"> <statusbarpanel> <box> <html:canvas id="myCanvas" width="15" height="15" style="border:1px solid black;"/> </box> </statusbarpanel> </statusbar> </overlay>
and some simple painting in JS:
var canvas = window.document.getElementById("myCanvas"); var ctx = canvas.getContext("2d"); ctx.fillStyle = "red"; ctx.fillRect(5,5,5,5);
If done right, you will get a result like this
CANVAS in XUL