Friday, September 26, 2008

ActiveX RDP taking %100 CPU on IE6

Here's a sneaky bug we've had (credits to colleagues Corin and Leeor for solving this one), thought I'd share.

When pointing IE6 at a page with the MS RDP ActiveX control the browser would freeze and consume %100 CPU once we navigated away. It turns out that IE6 doesn't like the ActiveX control and the jqModal jQuery plugin on the same page.

jqModal includes a workaround for the IE z-index bug (a.k.a the "bleed-through" bug, fixed in IE7) by positioning an iframe right behind the dialog if using IE6. For various reasons we disabled this behavior on IE6 (and we live with the bleed-through), but the '<iframe>' was still being created inside jqModal - just not added to the document. Not creating it at all solved the bug.

Here's the (quick and dirty) patch against jqModal 2008.07.06 +r13, disabling the bleed-through fix.

Change

var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version == "6.0"),F=false,
i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),
To
var s=0,H=$.jqm.hash,A=[],ie6=false,F=false,
i=$(''),

A proper diff is here.