javascript - How to save image to album if canvas same origin flag is dirty -
i facing hard situation here. building open web app display tweets. if of these tweets contains url image, display image image tag. want give user alternative save image album or share using share web activity.
all web activities work on image expect blob work. can't pass url it. can't build blob remote image because seek using drawimage canvas phone call blit image canvas security error on canvas due image not coming same origin app.
this "security" prevents types of fiddling remote images such saving disk or using web activities.
i understand part of spec don't understand purpose. images after , if scripting save of remote image there chance know doing 1 time again not part of w3c grouping decided spec , folks much smarter overseeing something...
anyway, lets summarize: "how go img tag source pointing @ remote location not same open web app blob can utilize web activities?"
thanks
then share activity back upwards using url. boilerplate app has example of this. if not mind app beingness privileged (which requires thorough review marketplace) can seek using systemxhr. code similar to:
var xhr = new xmlhttprequest({ mozsystem: true }); xhr.open("get", "url image", true); xhr.responsetype = "blob"; xhr.onload = function () { //sample activity - utilize activity requires blob var activity = new mozactivity({ name: "open", data: { type: "image/png", blob: this.response, }, }); }; xhr.onerror = function () { alert("error scheme xhr"); }; xhr.send(); javascript html5 html5-canvas firefox-os
No comments:
Post a Comment