Turns out it's very related to XHR callbacks and it's mostly my code, with perhaps a bit of Firebug (though I think of the "don't do that" kind).
When I reload or navigate away from the page, XHR ready states are changing and my callbacks called. Sometimes, when there's an issue, I'm seeing the underlying window object has already changed by the time the callback executes. This could be the object members getting cleared but in my case, the new window document.domain is different (at least at first) so I don't even get that far; I get permission errors. The right fix here is not to use the window object/global scope in the callback. After a bit of futzing around, I did that and it works great. As a point of interest, before doing that, I just put in code to catch the permission exception and return from the callback. This is where things with Firebug seemed to be a bit strange. Even though I was catching exception, Firebug gave "cannot find _firebugConsole" errors. I'm not quite sure why. My guess was that Firebug has worked into the exception chain (only when tracing was turned on?) and was being called enough I was catching the exception. Then it was falling into same hole, perhaps not being able to access the window object either? Maybe most crucially, once it got into this state, it didn't recover. The "cannot find" errors were coming from the newly loaded page: somehow the code in the callbacks was getting Firebug into a state where it never initialized correctly on the new page and required a reload (or several, since the new page had callbacks, too). In any case, working fine as long as I don't try to touch the global window object in callbacks that might fire via a reload/navigation. > -----Original Message----- > From: firebug@googlegroups.com [mailto:fire...@googlegroups.com] Behalf > Of Steven Parkes > Sent: Thursday, August 27, 2009 1:09 PM > To: Firebug > Subject: Firebug cannot find _firebugConsole element and document.domain > > > I'm seeing various numbers of "Firebug cannot find _firebugConsole > element" messages and wondering about thoughts on it. I see them > under FF 3.0.13 and 3.5.2 and FB 1.3.3, 1.4.*, and 1.5X.0a21. The more > recent the version, the more frequently I see the issue. > > When the issue occurs, generally I get "Firebug cannot find > _firebugConsole" for cases where the code is trying to do a > console.debug(...). When it works, I get the debugging in the console. > When it doesn't work, I get the error message. It works on some (re) > loads, not on others. The frequency of failure seems to be higher for > newer combinations of FF/FB. > > The thing that I think it triggering it is having multiple windows > with their document domains set (possibly in combination with active > XHR requests) when doing a (re)load. The main page sets its > document.domain and contains an iframe, the contents of which sets its > document.domain to the same value. > > Here's the console output when doing a reload that fails (this is > under 3.0.13/1.3.3 since it gives more output in the console (not sure > which to turn tracing on on in newer versions: > > Firebug cannot find _firebugConsole element > commandLine.evaluate FAILED: Error: Permission denied to set property > Window.r > [Break on this error] (200 out of range 2) > FirebugC...uate,with (line 200) Window localhost:3000 > Firebug cannot find _firebugConsole element > commandLine.evaluate FAILED: Error: Permission denied to set property > Window.r > [Break on this error] (200 out of range 2) > FirebugC...uate,with (line 200) Window localhost:3000 > Firebug cannot find _firebugConsole element > commandLine.evaluate FAILED: Error: Permission denied to set property > Window.r > [Break on this error] (200 out of range 2) > FirebugC...uate,with (line 200) Window localhost:3000 > Strophe is not defined > [Break on this error] Strophe.debug("request id " + req.id + > strophe....251401953 (line 2150) > listeninglocalhost:3000 (line 55) > creatingxmpp.js?...251402053 (line 44) > 1 _connect_cb was called > 1 SASL authentication succeeded. > 1 no requests during idle cycle, sending blank request > > Sorry it's ugly, but I think the key issue is the permissions denied > part of the message. I think there's some kind of race going on > relative to the document domains, but beyond that ... > > The timing ... well I'm not sure I understand it exactly. The line > "Strophe is not defined" is actually an error being generated because > there's a callback on an outstanding XHR request that is trying to > access an object that appears to have already been destroyed. I don't > think this is related, but ... > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Firebug" group. To post to this group, send email to firebug@googlegroups.com To unsubscribe from this group, send email to firebug+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/firebug?hl=en -~----------~----~----~----~------~----~------~--~---