I am using following code:
var myExtension = { init: function() { // The event can be DOMContentLoaded, pageshow, pagehide, load or unload.
$() will use the document of the current window by default. Which is actually browser.xul in your case. You need to operate on the sub-document, which you already got via var doc = aEvent.originalTarget;, so this should work I think (untested)
$()
var doc = aEvent.originalTarget;
$(doc).find("#blueBar")