{"id":80,"date":"2007-04-12T21:25:49","date_gmt":"2007-04-12T19:25:49","guid":{"rendered":"http:\/\/lukav.com\/wordpress\/2007\/04\/12\/firefox-firebug-and-synchronos-calls-problem\/"},"modified":"2025-05-24T16:27:22","modified_gmt":"2025-05-24T14:27:22","slug":"firefox-firebug-and-synchronos-calls-problem","status":"publish","type":"post","link":"https:\/\/lukav.com\/wordpress\/2007\/04\/12\/firefox-firebug-and-synchronos-calls-problem","title":{"rendered":"Firefox firebug and synchronos calls problem"},"content":{"rendered":"<p>For those of you that have discovered that when you have <a href=\"http:\/\/getfirebug.com\/\">Firebug <\/a>installed and are developing some synchronous XMLHttpRequest everything works, and when you disable it it stops: here is the problem.<\/p>\n<p>Believe it or not it is a bug in <a href=\"http:\/\/firefox.com\/\">Firefox<\/a> NOT in Firebug.  It turns out that <a href=\"http:\/\/firefox.com\/\">Firefox<\/a> doesn&#8217;t call onreadystatechange when the you set the 3 parameter (async) to false in open. Probably <a href=\"http:\/\/firefox.com\/\">FF <\/a>expects that when a call is synchronous the developer will  process the result in the lines following the send call. May be this make sense, but if you want to quickly test async\/sync calls or use a library that doesn&#8217;t take care of this, you be in trouble.<\/p>\n<p>I can say for certain (I&#8217;ve committed the code myself) that the next release of <a href=\"http:\/\/sourceforge.net\/projects\/oat\">OpenLink AJAX Toolkit<\/a> won&#8217;t have this problem and will make no difference if you have <a href=\"http:\/\/getfirebug.com\/\">Firebug <\/a>or not.<\/p>\n<p>I use the following to catch the situation where <a href=\"http:\/\/getfirebug.com\/\">Firebug <\/a>is not installed or is installed but disabled:<\/p>\n<pre>if (OAT.Browser.isGecko)\r\n{\r\n  try {\r\n    if (!xhr.options.async &amp;&amp; xhr.obj.onreadystatechange == null) {\r\n      OAT.AJAX.response(xhr);\r\n    }\r\n  } catch (e) {\r\n    if ((e.message &amp;&amp; e.message == 'Permission denied to create wrapper for object of class UnnamedClass') ||\r\n         e == 'Permission denied to create wrapper for object of class UnnamedClass')\r\n      OAT.AJAX.response(xhr);\r\n }\r\n}<\/pre>\n<p>OAT.Dom.isGecko() &#8211; return true if it mozilla and derivatives<br \/>\nOAT.AJAX.response &#8211; is the function that is normally called when the request finish.<br \/>\nxhr.options.async &#8211; is holding if the call is async or not<br \/>\nxhr.obj.onreadystatechange &#8211; is the original Firefox XMLHttpRequest object instance, since the code above works in the context of <a href=\"http:\/\/sourceforge.net\/projects\/oat\">OAT<\/a><\/p>\n<div id=\"facebook_like\"><iframe src=\"\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Flukav.com%2Fwordpress%2F2007%2F04%2F12%2Ffirefox-firebug-and-synchronos-calls-problem&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=segoe+ui&amp;colorscheme=light&amp;height=80\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:500px; height:80px;\" allowTransparency=\"true\"><\/iframe><\/div>","protected":false},"excerpt":{"rendered":"<p>For those of you that have discovered that when you have Firebug installed and are developing some synchronous XMLHttpRequest everything works, and when you disable it it stops: here is the problem. Believe it or not it is a bug in Firefox NOT in Firebug. It turns out that Firefox doesn&#8217;t call onreadystatechange when the [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[70,110,90,40],"tags":[],"class_list":["post-80","post","type-post","status-publish","format-standard","hentry","category-en","category-oat","category-openlink","category-tech"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/lukav.com\/wordpress\/wp-json\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lukav.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lukav.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lukav.com\/wordpress\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/lukav.com\/wordpress\/wp-json\/wp\/v2\/comments?post=80"}],"version-history":[{"count":4,"href":"https:\/\/lukav.com\/wordpress\/wp-json\/wp\/v2\/posts\/80\/revisions"}],"predecessor-version":[{"id":791,"href":"https:\/\/lukav.com\/wordpress\/wp-json\/wp\/v2\/posts\/80\/revisions\/791"}],"wp:attachment":[{"href":"https:\/\/lukav.com\/wordpress\/wp-json\/wp\/v2\/media?parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lukav.com\/wordpress\/wp-json\/wp\/v2\/categories?post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lukav.com\/wordpress\/wp-json\/wp\/v2\/tags?post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}