MCPcopy
hub / github.com/audreyt/ethercalc / autoBoot

Function autoBoot

packages/client/src/boot.ts:335–352  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

333}
334
335async 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
354if (typeof document !== 'undefined' && typeof window !== 'undefined') {
355 if (document.readyState === 'loading') {

Callers 1

boot.tsFile · 0.85

Calls 4

installSanitizeHtmlFunction · 0.90
installGraphFunction · 0.90
runMainFunction · 0.90
initializeSpreadsheetFunction · 0.85

Tested by

no test coverage detected