···181181 var html = await response.text();
182182 var doc = parser.parseFromString(html, 'text/html');
183183184184- // If the target page has a different x-ocaml universe, the worker
185185- // must be restarted. x-ocaml initializes once at script load, so
186186- // we fall back to a full page load to get a fresh environment.
187187- var curUniverse = (document.querySelector('meta[name="x-ocaml-universe"]') || {}).content || '';
188188- var newUniverse = (doc.querySelector('meta[name="x-ocaml-universe"]') || {}).content || '';
189189- if (curUniverse !== newUniverse) {
190190- window.location.href = ROOT_URL + url;
191191- return;
192192- }
193193-194184 // Swap content — use DOM node adoption instead of innerHTML so that
195185 // custom elements (e.g. <x-ocaml>) get properly connected and their
196186 // connectedCallback fires.