()
| 333 | } |
| 334 | |
| 335 | async function autoBoot(): Promise<void> { |
| 336 | if (typeof document === 'undefined' || typeof window === 'undefined') return; |
| 337 | const w = window as unknown as BootHost; |
| 338 | if (!w.SocialCalc) return; |
| 339 | // Close the stored-XSS hole in the live editor: the served SocialCalc |
| 340 | // runtime renders `text-html` cell values straight into the cell div's |
| 341 | // innerHTML. Install the DOMPurify-backed hook the rewritten render sink |
| 342 | // calls (see scripts/build-assets.sh) before any sheet data is parsed. |
| 343 | installSanitizeHtml(w.SocialCalc, DOMPurify); |
| 344 | installGraph({ |
| 345 | SocialCalc: w.SocialCalc, |
| 346 | win: window as unknown as Parameters<typeof installGraph>[0]['win'], |
| 347 | doc: document, |
| 348 | }); |
| 349 | const handle = runMain({ host: w }); |
| 350 | if (!handle) return; |
| 351 | initializeSpreadsheet(w); |
| 352 | } |
| 353 | |
| 354 | if (typeof document !== 'undefined' && typeof window !== 'undefined') { |
| 355 | if (document.readyState === 'loading') { |
no test coverage detected