This looks like it will need a custom IDocHostUIHandler to return an VB6 object on `GetExternal` so the JS part can interface with something like `window.external.previewpopup('1')`

Doable but this is going to be tricky and hard to debug implementation requiring a custom .tlb, a bit of multi-threading and probably interface hooking on the VB6 container the std web browser control is sited on.

Here is an old gist with a barebone sample that won't compile as some dependencies are missing.

cheers,
</wqw>