Just passing this on. I wrote a WebGL / WebGL2 wrapper that simulates multiple webgl contexts on top of a single actual webgl context.
I'd actually written it a while ago but that version queried the state and was too slow. I updated it to shadow the state and now it's fast.
(*) sharing resources across contexts / libraries.
(*) using more contexts than the browser itself allows
I mostly wrote it just as something fun to try to write but recently someone had a real need which led to the update.