/** Preserve the existing document_idle initialization and observer behavior. */ function startContentApplication({ environment, page, styles, products }) { if (!page.isAllowedPage()) return; styles.ensureExtensionStyles(); products.ensureProductsBackgroundMessageHandler(); environment.window?.addEventListener?.("hashchange", () => page.insertTile()); if (page.insertTile()) return; const observer = new environment.MutationObserver(() => page.insertTile()); observer.observe(environment.document.documentElement, { childList: true, subtree: true }); }