This code work for me for downloading a canvas as an image in a custom html page:
var save = function() {
var x= document.getElementById("output-canvas");
var dt = x.toDataURL('image/png');
this.href = dt;
};
downloadLink.addEventListener('click', save, false);
but it doesn't work (without any errors) for canvas in popup.html in a chrome plugin which i am developing.
Could anybody help me with a solution for downloading canvas items in a chrome plugin?
Edited:
This is my manifest file:
{
...
"permissions": [ "contextMenus", "tabs", "http://*/*", "https://*/*", "activeTab", "storage"],
...
}