A browser extension that lets you summarize any webpage and ask questions using AI.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

changed my mind and added scrolling back

+13
+13
popup/popup.js
··· 243 243 } 244 244 } 245 245 246 + /** Keep the main scroll area pinned to the bottom while text streams in. */ 247 + function scrollContentWithStream() { 248 + requestAnimationFrame(() => { 249 + const el = document.querySelector(".content-container"); 250 + if (el) { 251 + el.scrollTop = el.scrollHeight; 252 + } 253 + }); 254 + } 255 + 246 256 function handleStreamDone(message) { 247 257 const error = message?.error; 248 258 const cancelled = Boolean(message?.cancelled); ··· 298 308 } 299 309 // Render markdown during streaming for consistent formatting 300 310 lastAssistantMsg.innerHTML = renderMarkdown(content); 311 + scrollContentWithStream(); 301 312 } 302 313 } 303 314 ··· 331 342 // Render markdown content 332 343 htmlContent += renderMarkdown(content); 333 344 currentStreamElement.innerHTML = htmlContent; 345 + scrollContentWithStream(); 334 346 } 335 347 } 336 348 ··· 1000 1012 resultContainer.innerHTML = ""; 1001 1013 resultContainer.appendChild(streamingEl); 1002 1014 currentStreamElement = streamingEl; 1015 + scrollContentWithStream(); 1003 1016 1004 1017 // Start streaming request 1005 1018 chrome.runtime.sendMessage({