canvas.convertToBlob() doesn't throw on a format it can't encode. It hands you a PNG.

· Dev.to