| 1 | | /* |
| 2 | | Enumerating: document.location |
| 3 | | document.location.hash = #x |
| 4 | | document.location.host = www.google.com |
| 5 | | document.location.hostname = www.google.com |
| 6 | | document.location.href = http://www.google.com/search?q=foo&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official#x |
| 7 | | document.location.pathname = /search |
| 8 | | document.location.port = |
| 9 | | document.location.protocol = http: |
| 10 | | document.location.search = ?q=foo&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official |
| 11 | | document.location.replace = function replace() { [native code] } |
| 12 | | document.location.assign = function assign() { [native code] } |
| 13 | | document.location.reload = function reload() { [native code] } |
| 14 | | */ |
| 15 | | |
| 54 | | dumpProps:function(obj, withFuncs) { |
| 55 | | dump('--------------------------------------------\n'); |
| 56 | | dump(obj+'\n\n'); |
| 57 | | var s=''; |
| 58 | | for (i in obj) { |
| 59 | | try { |
| 60 | | if (!withFuncs && 'function'==typeof obj[i]) continue; |
| 61 | | s=i+': '+obj[i]; |
| 62 | | s=s.replace(/\n\s*./, 'n'); |
| 63 | | dump( s.substring(0, 79)+'\n' ); |
| 64 | | } catch (e) { } |
| 65 | | } |
| 66 | | dump('\n'); |
| 67 | | }, |
| 68 | | |
| 69 | | findTag:function(tagName) { |
| 70 | | var el=document.popupNode; |
| 71 | | |
| 72 | | try { |
| 73 | | while (el && el.tagName && tagName!=el.tagName) { |
| 74 | | el=el.parentNode; |
| 75 | | } |
| 76 | | return el; |
| 77 | | } catch (e) { } |
| 78 | | return null; |
| 79 | | }, |
| 80 | | |
| 81 | | // // // // // // // // // // // // // // // // // // // // // // // // // // // |
| 82 | | |
| | 113 | } |
| | 114 | |
| | 115 | break; |
| | 116 | case 'msn': |
| | 117 | //FD382E93B5ABC456C5E34C238A906CAB2DEEB5D6 |
| | 118 | //ugh, they've got an API but .. SOAP? blech too complicated |
| | 119 | |
| | 120 | var searchUrl='http://search.msn.com/results.aspx?q='+encUrl; |
| | 121 | |
| | 122 | var xhr=new XMLHttpRequest(); |
| | 123 | xhr.open('GET', searchUrl, false); |
| | 124 | xhr.send(null); |
| | 125 | |
| | 126 | try { |
| | 127 | var m=xhr.responseText.match(/<a href=\"([^\"]+)\">Cached page/); |
| | 128 | gotoUrl=m[1]; |
| | 129 | gotoUrl=gotoUrl.replace('&', '&'); |
| | 130 | } catch (e ) { |
| | 131 | gotoUrl=searchUrl; |