experiments in a post-browser web
10
fork

Configure Feed

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

fix: page host stuck loading on aborted navigations (webbeef.org)

+8 -7
+8 -7
app/page/page.js
··· 1335 1335 }); 1336 1336 1337 1337 webview.addEventListener('did-fail-load', (e) => { 1338 + if (!e.isMainFrame) return; 1339 + 1338 1340 if (e.errorCode === -3) { 1339 - // Error -3 (ABORTED) normally fires during legitimate re-navigation and is safe to ignore. 1340 - // However, if no page has ever loaded (e.g. URL triggered a download instead), 1341 - // the window is stuck in loading state forever — clear it. 1342 - if (!hasEverLoaded) { 1343 - console.log('[page] Load aborted before any page loaded (likely download), clearing loading state'); 1344 - loadingLifecycle.stopLoading(); 1345 - } 1341 + // Error -3 (ABORTED) fires during legitimate re-navigation (e.g. clicking a link 1342 + // while a page is loading) AND for cancelled navigations (downloads, window.stop(), 1343 + // intercepted popups, etc.). Always clear loading state — if a new navigation is 1344 + // starting, did-start-navigation will immediately re-enter startLoading(). 1345 + console.log('[page] Load aborted (error -3), clearing loading state'); 1346 + loadingLifecycle.stopLoading(); 1346 1347 return; 1347 1348 } 1348 1349 console.error('[page] Load failed:', e.errorCode, e.errorDescription);