Add a warning/suggestion to canvas.toDataURL to prefer toBlob #33748
Labels
Content:WebAPI
Web API docs
effort: small
This task is a small effort.
good first issue
A good issue for newcomers to get started with.
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL
What specific section or headline is this issue about?
No response
What information was incorrect, unhelpful, or incomplete?
toDataURL creates huge strings, which can be inefficient memory-wise. Due to the URL size limit in Firefox (and other browsers?)
toDataURL
can actually return strings that are too large to be parsed when assigned to e.g.img.src
.What did you expect to see?
I think it would be useful to have an information box on the toDataURL page to suggest using toBlobURL in combination with URL.createObjectURL instead, i.e. this example.
Do you have any supporting links, references, or citations?
https://bugzilla.mozilla.org/show_bug.cgi?id=1898679
Do you have anything more you want to share?
No response
The text was updated successfully, but these errors were encountered: