General source code refactoring
This commit is contained in:
9
src/content/main.js
Normal file
9
src/content/main.js
Normal file
@@ -0,0 +1,9 @@
|
||||
/** Preserve the existing document_idle initialization and observer behavior. */
|
||||
function startContentApplication({ environment, page, styles, products }) {
|
||||
if (!page.isAllowedPage()) return;
|
||||
styles.ensureExtensionStyles();
|
||||
products.ensureProductsBackgroundMessageHandler();
|
||||
if (page.insertTile()) return;
|
||||
const observer = new environment.MutationObserver(() => page.insertTile());
|
||||
observer.observe(environment.document.documentElement, { childList: true, subtree: true });
|
||||
}
|
||||
Reference in New Issue
Block a user