Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: files/download.js

Issue 8483154: Adding ABP core modules to ABP/Opera (Closed)
Patch Set: Created Oct. 9, 2012, 9:51 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 function download(url) {
2 if(url.indexOf("http") == 0) { //Only accepts http and https URLs
3 try {
4 var request = new window.XMLHttpRequest();
5 request.open('GET', url, false);
6 if(opera.version() >= 12.1)
7 request.timeout(12000); //Only supported in Oper a 12.1+, 12 seconds timeout
8 request.send();
9 if (request.readyState == 4 && request.status == 200) {
10 return request.responseText;
11 }
12 }
13 catch(e) {}
14 }
15 return false;
16 }
OLDNEW

Powered by Google App Engine
This is Rietveld