Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions app/import/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,19 @@ const BOOKMARKLET_SCRIPT = `(async function(){
if(all.length>lastCount){stagnant=0;lastCount=all.length;}
else{
stagnant++;
if(stagnant>=8){
// Loading often pauses for many seconds (rate limits, slow fetches);
// nudge the timeline up and back down to retrigger loading instead of giving up.
if(stagnant%10===0&&stagnant<40){
window.scrollTo(0,Math.max(0,document.documentElement.scrollHeight-2600));
if(col)col.scrollTo(0,Math.max(0,col.scrollHeight-2600));
await sleep(1200);
window.scrollTo(0,document.documentElement.scrollHeight);
await sleep(2000);
if(col)col.scrollTo(0,col.scrollHeight);
await sleep(3000);
}
if(stagnant>=40){
window.scrollTo(0,document.documentElement.scrollHeight);
await sleep(5000);
if(all.length===lastCount){
autoScrolling=false;
autoBtn.textContent='\u2705 Done \u2014 '+all.length+' captured';
Expand Down Expand Up @@ -295,9 +305,19 @@ const CONSOLE_SCRIPT = `(async function() {
if (all.length > lastCount) { stagnant = 0; lastCount = all.length; }
else {
stagnant++;
if (stagnant >= 8) {
// Loading often pauses for many seconds (rate limits, slow fetches);
// nudge the timeline up and back down to retrigger loading instead of giving up.
if (stagnant % 10 === 0 && stagnant < 40) {
window.scrollTo(0, Math.max(0, document.documentElement.scrollHeight - 2600));
col?.scrollTo(0, Math.max(0, col.scrollHeight - 2600));
await sleep(1200);
window.scrollTo(0, document.documentElement.scrollHeight);
col?.scrollTo(0, col.scrollHeight);
await sleep(3000);
}
if (stagnant >= 40) {
window.scrollTo(0, document.documentElement.scrollHeight);
await sleep(2000);
await sleep(5000);
if (all.length === lastCount) {
autoScrolling = false;
autoBtn.textContent = \`✅ Done — \${all.length} captured\`;
Expand Down