I'm creating an extension to download canvas as an image using the chrome.downloads api, the canvas is tainted so I can't use canvas.toDataUrl() to download the canvas as image, Chrome doesn't allow exporting tainted canvas but it allows downloading the tainted canvas from context-menu, we may use the "save image as" option from the context menu of canvas as can be seen in the following image, but I don't know how.
But I prefer chrome.downloads API, it provides a method called "download" which takes a string argument, but I don't know how to download canvas with the chrome.downloads.download method, So please let me know whether it's possible to download canvas as image using chrome.downloads API.