top of page

Infinite | Craft Userscript

// Alternative: observe DOM changes for new elements const observer = new MutationObserver(() => const elements = document.querySelectorAll('.element'); elements.forEach(el => const name = el.textContent?.trim(); if (name && !discovered.has(name)) discovered.add(name); ); updateRecipeBook(); ); observer.observe(document.body, childList: true, subtree: true );

// Attach click handlers to rows document.querySelectorAll('.ic-recipe-row').forEach(row => row.addEventListener('click', (e) => const left = row.getAttribute('data-left'); const right = row.getAttribute('data-right'); if (left && right) autoCraft(left, right); e.stopPropagation(); ); ); infinite craft userscript

toggleBtn.addEventListener('click', () => recipesPanel.style.display = recipesPanel.style.display === 'none' ? 'block' : 'none'; ); // Alternative: observe DOM changes for new elements

bottom of page