Changeset 96

Show
Ignore:
Timestamp:
05/14/06 19:09:01 (4 years ago)
Author:
t-bone
Message:

yahoo works, probably as well as it will

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • extension/resurrect/content/resurrect.js

    r95 r96  
    1919        {name:'CoralCDN', id:'coralcdn'}, 
    2020        {name:'Google Cache', id:'google'}, 
     21        {name:'The Internet Archive', id:'archive'} 
     22        {name:'MSN Cache', id:'msn'}, 
    2123        {name:'Yahoo! Cache', id:'yahoo'}, 
    22         {name:'MSN Cache', id:'msn'}, 
    23         {name:'The Internet Archive', id:'archive'} 
    2424    ], 
    2525 
     
    3939        resurrect.clickTarget=event.target; 
    4040 
    41         var onDocument=!(  
    42             gContextMenu.isContentSelected || gContextMenu.onTextInput ||  
    43             gContextMenu.onLink || gContextMenu.onImage  
     41        var onDocument=!( 
     42            gContextMenu.isContentSelected || gContextMenu.onTextInput || 
     43            gContextMenu.onLink || gContextMenu.onImage 
    4444        ); 
    4545 
     
    134134            gotoUrl='http://web.archive.org/web/*/'+rawUrl 
    135135            break; 
     136        case 'yahoo': 
     137            //opener.resurrect.yahooApi(encUrl); 
     138            var xhr=new XMLHttpRequest(); 
     139            xhr.open('GET', 
     140                'http://api.search.yahoo.com/WebSearchService/V1/'+ 
     141                'webSearch?appid=firefox-resurrect&query='+encUrl+'&results=1', 
     142                false 
     143            ); 
     144            xhr.send(null); 
     145 
     146            try { 
     147                var c=xhr.responseXML.getElementsByTagName('Cache'); 
     148                gotoUrl=c[0].firstChild.textContent; 
     149            } catch (e ) { 
     150                gotoUrl='http://search.yahoo.com/search?p='+encUrl; 
     151            } 
     152 
     153            break; 
    136154        } 
    137155        if (gotoUrl) {