Installs the overlay runtime on win (idempotent) and returns it.
Written to be both callable directly (jsdom tests) and serializable via
Function.prototype.toString() for browser injection — so it must not
reference any module-scope binding. The overlay lives in a shadow root so page
styles can't break it (and it can't leak styles into the page), and every
diagnostic is rendered with textContent, never as HTML.
Installs the overlay runtime on
win(idempotent) and returns it.Written to be both callable directly (jsdom tests) and serializable via
Function.prototype.toString()for browser injection — so it must not reference any module-scope binding. The overlay lives in a shadow root so page styles can't break it (and it can't leak styles into the page), and every diagnostic is rendered withtextContent, never as HTML.