Skip to content

Instantly share code, notes, and snippets.

@PaulKinlan
Created June 1, 2012 17:51
Show Gist options
  • Save PaulKinlan/2853982 to your computer and use it in GitHub Desktop.
Save PaulKinlan/2853982 to your computer and use it in GitHub Desktop.
http://webintents.org/save image/* as URL client
var i = new Intent({
"action": "http://webintents.org/save",
"type": "image/*",
"extras": { "url": "http://placekitten.com/g/200/300" }
})
var onsuccess = function(data) {
var img1 = document.getElementById("img1");
if(data instanceof Blob) {
img1.src = URL.createObjectURL(data);
}
else {
img1.src = data;
}
};
var onerror = function(){ };
window.navigator.startActivity(i, onsuccess, onerror);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment