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!
Have you considered using viewof? That way you could add the iframe to the DOM (within the cell wrapper) and still return a promise as value. It would also allow you to wrap iframe modifications in a custom API.