I made something similar a while ago for locally viewing zipped webpages (a zip which has an index.html file and any related structure of files: images, css, js, folders etc.). It has two parts: a viewer[1] (12KB) and a wrapper[2] (16KB). Both run offline as single file HTML vanilla JS tools. The wrapper bundles a given zipped webpage and the viewer code into a self-extracting HTML file that also runs offline (as in `file:///`). I only needed it to work with simple zips but it shouldn't need much work to deal with more interesting ones.
[1] https://gregabbott.pages.dev/zipped-webpage-view/
[2] https://gregabbott.pages.dev/zipped-webpage-wrap/