diff --git a/chrome/content/zotero/xpcom/file.js b/chrome/content/zotero/xpcom/file.js index 9ad7eec4e..bc89bb68e 100644 --- a/chrome/content/zotero/xpcom/file.js +++ b/chrome/content/zotero/xpcom/file.js @@ -216,6 +216,17 @@ Zotero.File = new function(){ } + /* + * Return a promise for the contents of a URL as a string + */ + this.getContentsFromURLAsync = function (url) { + return Zotero.HTTP.promise("GET", url, { responseType: "text" }) + .then(function (xmlhttp) { + return xmlhttp.response; + }); + } + + /* * Write string to a file, overwriting existing file if necessary */