We don't show the loading indicator at all between clicks. Instead, just
append the new iframe. Delete the old iframe when the new one sent the
"ready" message. This way we prevent flashing of the white browser
background, which looks jarring when viewing dark mode pages.
Instead of inserting the entire global context into the iframe's HTML,
where we need to encode it to and decode it from JSON and base64, we
only insert a stripped global context, i.e. without the file tree and
the utils. If these are needed in the iframe, for example when a script
changes the DOM and needs to load an image, we use messages to
communicate with the parent document and retrieve the file in question.