FireBug Lite messageQueue null

妖精的绣舞 提交于 2019-12-17 18:26:25

问题


I'm trying to get FireBug Lite working with IE7. Given this code (and nothing else):

<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"></script>
<link rel="stylesheet" href="../../css/third-party/jquery.ui.all.css">
This is a test!

...I get an error at Line: 8180, 'this.messageQueue is null or not an object' and the console does not appear.

If I remove the CSS file reference, it works fine. Also, this CSS works fine with FireBug under FF and GC.

The CSS file is a recent download from jQ's web site and contains nowhere near 8,000 lines (after expanding all @imports), nor does any of the code accessible to my web server contain the token 'messageQueue'.

I don't have any IE plugins (that I am aware of) and have never used any sort of MSMQ products on this PC.

I also tried random things such as switching the order of statements, loading jQuery's regular .js files, using the FireBug bookmarklet instead, etc., all to no avail.

Any advice?


回答1:


This is a known bug that affects IE7 (and IE8) and is being tracked on the firebug issue tracker.

This is still an issue on all channels (Firebug 1.4 stable/debug/beta/developer).

Disclaimer: If you're going to use these methods, please subscribe to the discussion about this bug and make sure you stop using this contrived one either when it's fixed, or Firebug 1.5 comes out.

If you need to use firebug now, you could use firebug 1.3. This method I can't find documented anywhere...

<script type="text/javascript"
    src="https://getfirebug.com/releases/lite/1.3/firebug-lite.js"></script>

A better approach would be to use Firebug 1.3 as a bookmarklet. I've hacked up this bookmarklet URL based on the firebug release archive:

javascript:(function(F,i,r,e,b,u,g,L,I,T,E){if(F.getElementById(b))return;E=F[i+'NS']&&F.documentElement.namespaceURI;E=E?F[i+'NS'](E,'script'):F[i]('script');E[r]('id',b);E[r]('src',I+g+T);E[r](b,u);(F[e]('head')[0]||F[e]('body')[0]).appendChild(E);E=new%20Image;E[r]('src',I+L);})(document,'createElement','setAttribute','getElementsByTagName','FirebugLite','3','releases/lite/1.3/firebug-lite.js','releases/lite/latest/skin/xp/sprite.png','https://getfirebug.com/','#startOpened');

Just dump it into your 'links' bar using the above in the URL field.




回答2:


One possible cause of this: if there's no stylesheet or CSS style data. No idea why.

If there is no CSS and you're seeing this error, add some and Firebug Lite might just work again.


For example, this JSbin, with a token CSS rule, works with Firebug Lite in IE8:

http://jsbin.com/etecub/5/

Code: http://jsbin.com/etecub/5/edit


This JSbin, identical but with no CSS rules, fails to load Firebug Lite in IE8 with the error 'this.messageQueue' is null or not an object:

http://jsbin.com/etecub/6/

Code: http://jsbin.com/etecub/6/edit


It seems like it doesn't matter if the rule is actually applied or not (e.g. http://jsbin.com/etecub/9 works fine). If you've got a stylesheet attached and see this error anyway, and the above doesn't work, maybe try adding a <style> block to the document with a CSS rule or two.




回答3:


I had the same issue with Firebug Lite not opening with my Meteor App.

After reading the bugtracker discussions I tried the debug-version, which is basically only the uncompressed version of the library. And yes, that made the difference and Firebug Lite now starts in both Chrome and Safari.

The tag I am using right now:

<script type="text/javascript" src="https://getfirebug.com/firebug-lite-debug.js"></script>



回答4:


Just saw an answer that helped me, from here: https://github.com/angular/angular.js/issues/3596. The bug-report itself is on the Angular project repo, but it doesn't have anything to do with Angular -- the problem, for me, was manifesting itself on a vanilla HTML/CSS/JS page, and the fix worked there as well.

Quoting from there:

firebug-lite-beta.js:30905 Uncaught TypeError: Cannot read property 'push' of undefined

Adding basic null check:

if (typeof this.messageQueue == 'undefined') {

       this.messageQueue = [];

}

Seems to be solving the issue.



来源:https://stackoverflow.com/questions/7532909/firebug-lite-messagequeue-null

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!