an iframe loses its service worker after document.write is called in the iframe. Same for about:blank or srcdoc: iframe.
As a work-around, prevent document.write() calls from being made, and instead store the written text, create blob, and load via service-worker /blob:<blob id> response, thereby allowing the iframe to still be controlled by the service worker.
Also override srcdoc: assignment and convert to blob in the same way
Due to several issues in Chrome, in particular: https://bugs.chromium.org/p/chromium/issues/detail?id=880768 https://bugs.chromium.org/p/chromium/issues/detail?id=1102209
an iframe loses its service worker after document.write is called in the iframe. Same for about:blank or srcdoc: iframe. As a work-around, prevent document.write() calls from being made, and instead store the written text, create blob, and load via service-worker
/blob:<blob id>
response, thereby allowing the iframe to still be controlled by the service worker. Also override srcdoc: assignment and convert to blob in the same way