Loading Ragebait Generator...
/gmi, ""); const scriptContent = doc.querySelector('script') ? doc.querySelector('script').innerHTML : ''; // 2. Inject into the page with Global WP Overrides const root = document.getElementById('ragebait-tool-root'); root.innerHTML = `
${bodyContent}
`; // 3. Execute the Logic const scriptEl = document.createElement('script'); scriptEl.text = scriptContent; document.body.appendChild(scriptEl); // 4. Smooth Scroll Override // We wrap the original generate function to ensure it scrolls to results const originalGenerate = window.generate; window.generate = function() { if (typeof originalGenerate === 'function') { originalGenerate(); setTimeout(() => { const output = document.getElementById('output-area'); if (output) { output.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }, 450); } }; // Initialize the counter setTimeout(() => { if (typeof updateCount === 'function') updateCount(); }, 100); }) .catch(err => { document.getElementById('ragebait-tool-root').innerHTML = "Error loading tool."; console.error(err); }); })();