In https://observablehq.com/@mbostock/file-input, an image(HTMLImageElement) is prepared in a Promise and resolved when it has loaded, so that other cells then directly have access to the loaded image.
I expected to be able to do the same with an iframe, since it also has a load event. But it does not work the same way. I obtained something nearly satisfying but not exactly: https://observablehq.com/@severo/iframe-and-load-event
If you have comments or solutions, I would be happy to learn!