Ticket #29: UrlLib-XmlHttpRequestFixForRecentOperaReleases.patch

File UrlLib-XmlHttpRequestFixForRecentOperaReleases.patch, 2.0 kB (added by heldermagalhaes, 7 months ago)

Patch which fixes the issue.

  • urllib.js

    old new  
    151151        try{ //to get MS HTTP request object 
    152152            obj=new ActiveXObject("Msxml2.XMLHTTP.4.0"); 
    153153        }catch(e){ 
    154             try{ //to get MS HTTP request object 
     154            try{ //to get MS HTTP request object 
    155155                obj=new ActiveXObject("Msxml2.XMLHTTP"); 
    156156            }catch(e){ 
    157157                try{// to get the old MS HTTP request object 
     
    164164                    } 
    165165                } 
    166166            } 
    167         } 
     167        } 
    168168    } 
    169169    return obj; 
    170170}; 
     
    248248        xmlhttp.onreadystatechange=function(){ 
    249249            if (xmlhttp.readyState==4) { 
    250250                callback(xmlhttp); 
    251                 //xmlhttp.onreadystatechange = null; //help IE with garbage collection 
    252                 xmlhttp = null;  
     251                    //avoid this in Opera as it causes an issue 
     252                    if(!window.opera){ 
     253                        xmlhttp = null; //help IE with garbage collection 
     254                    } 
    253255            }else if (xmlhttp.readyState==2){ 
    254256                //status property should be available (MS IXMLHTTPRequest documentation) 
    255257                //in Mozilla it is not if the request failed(server not reachable) 
    256258                //in IE it is not available at all ?! 
     259                    //avoid this in Opera as it causes an exception 
     260                    if(!window.opera){ 
    257261                try{//see if it is mozilla otherwise don't care. 
    258262                    var isNetscape = netscape; 
    259263                    try{//if status is not available the request failed. 
    260264                        var s=xmlhttp.status; 
    261265                    }catch(e){//call the callback because Mozilla will not get to readystate 4 
    262266                        callback(xmlhttp); 
    263                         xmlhttp = null; 
     267                                xmlhttp = null; //help IE with garbage collection 
    264268                    } 
    265269                }catch(e){ 
    266270