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

Unified Diff: files/download.js

Issue 8493027: Acquired Opera AdBlock code (Closed)
Patch Set: Created Oct. 2, 2012, 1:15 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: files/download.js
===================================================================
new file mode 100644
--- /dev/null
+++ b/files/download.js
@@ -0,0 +1,14 @@
+function download(url) {
+ if(url.indexOf("http") == 0) { //Only accepts http and https URLs
+ try {
+ var request = new window.XMLHttpRequest();
+ request.open('GET', url, false);
+ request.send();
+ if (request.readyState == 4 && request.status == 200) {
+ return request.responseText;
+ }
+ }
+ catch(e) {}
+ }
+ return false;
+}

Powered by Google App Engine
This is Rietveld