Depending on whether toBlob is supported, getBlobFromCanvas will either use an asynchronous path (with toBlob) or a synchronous one (with toDataUrl).
The only way getBlobFromCanvas appears to work today is because it is used before windows.prompt which, asking info from a user, is slow enough to (most of the time) ensure that the async path has had time to finish. But that's not a reliable workaround.
Depending on whether toBlob is supported, getBlobFromCanvas will either use an asynchronous path (with toBlob) or a synchronous one (with toDataUrl).
The only way getBlobFromCanvas appears to work today is because it is used before windows.prompt which, asking info from a user, is slow enough to (most of the time) ensure that the async path has had time to finish. But that's not a reliable workaround.