experiments in a post-browser web
10
fork

Configure Feed

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

refactor(electron): delete extension-host.html guards (URL no longer produced)

`peek://app/extension-host.html` was the v1 consolidated extension
host iframe URL. The host window and its loader are gone, so guards
that filtered it out of session-save / focus-tracking / windows-list
are filtering on a string that nothing emits.

Removed guards:
- session.ts: 3 sites (save loop, before-quit reopenable filter,
saveSpaceWorkspaces filter)
- main.ts: closed-window stack push isBackgroundPage check
- app/lib/session.js: SYSTEM_WINDOW_URLS array
- features/windows/windows.js: list filter
- closed-window.test.ts / focused-window-tracking.test.ts /
session.test.ts: parallel guards in their `shouldSkipWindow`-style
helpers + the assertion-on-dead-behavior tests that asserted the
string was filtered (3 tests deleted)

Comment cleanup: ipc.ts, protocol.ts (3 backwards-compat blocks),
izui-behavior.spec.ts — drop "extension-host iframe" mentions.

Unit tests: 2280 → 2277 (3 deletions, all green).
No other failures — confirms guards were already filtering on a
string nothing emits. Stale session JSON on disk still works:
unrecognized peek:// URLs already get filtered by the existing
`getRegisteredExtensionIds()` check upstream of the deleted guard.

+11 -48
-1
app/lib/session.js
··· 47 47 */ 48 48 export const SYSTEM_WINDOW_URLS = [ 49 49 'peek://app/background.html', 50 - 'peek://app/extension-host.html', 51 50 ]; 52 51 53 52 // ============================================================================
+1 -11
backend/electron/closed-window.test.ts
··· 85 85 const isModal = params.modal === true; 86 86 const isWebUrl = address && (address.startsWith('http://') || address.startsWith('https://')); 87 87 const isPeekUrl = address && address.startsWith('peek://'); 88 - const isBackgroundPage = address && (address.includes('background.html') || address.includes('extension-host.html')); 88 + const isBackgroundPage = address && address.includes('background.html'); 89 89 const isReopenable = (isWebUrl || (isPeekUrl && !isBackgroundPage)) && !!address; 90 90 const isContentRole = !role || role === 'content' || role === 'child-content' || role === 'workspace'; 91 91 ··· 327 327 it('does NOT save peek://app/background.html', () => { 328 328 const entry = createClosedWindowEntry( 329 329 { address: 'peek://app/background.html' }, 330 - null, 331 - null, 332 - 'test-ext', 333 - ); 334 - assert.strictEqual(entry, null); 335 - }); 336 - 337 - it('does NOT save peek://app/extension-host.html', () => { 338 - const entry = createClosedWindowEntry( 339 - { address: 'peek://app/extension-host.html' }, 340 330 null, 341 331 null, 342 332 'test-ext',
+1 -6
backend/electron/focused-window-tracking.test.ts
··· 32 32 * Excludes background, non-focusable, and overlay windows. 33 33 */ 34 34 function trackVisibleWindowFocus(win: MockWindow): void { 35 - if (win.url === 'peek://app/background.html' || win.url === 'peek://app/extension-host.html') { 35 + if (win.url === 'peek://app/background.html') { 36 36 return; 37 37 } 38 38 if (!win.focusable) { ··· 80 80 81 81 it('does not track background windows', () => { 82 82 trackVisibleWindowFocus({ id: 1, url: 'peek://app/background.html', focusable: true }); 83 - assert.strictEqual(getFocusedVisibleWindowId(), null); 84 - }); 85 - 86 - it('does not track extension-host windows', () => { 87 - trackVisibleWindowFocus({ id: 1, url: 'peek://app/extension-host.html', focusable: true }); 88 83 assert.strictEqual(getFocusedVisibleWindowId(), null); 89 84 }); 90 85
+1 -1
backend/electron/ipc.ts
··· 1008 1008 1009 1009 // Phase 2: Promote 'content' to 'child-content' when opened from a real parent. 1010 1010 // Extensions may explicitly pass role:'content' for web pages, but if the IPC 1011 - // sender is a visible window (not background/extension-host), the opened page 1011 + // sender is a visible window (not the background renderer), the opened page 1012 1012 // is semantically a child — ESC should close it and return to the parent. 1013 1013 if (role === 'content' && parentWindowId != null) { 1014 1014 console.log(`[izui] Promoting content -> child-content (parent: ${parentWindowId})`);
+1 -1
backend/electron/main.ts
··· 503 503 const isModal = windowData.params.modal === true; 504 504 const isWebUrl = address && (address.startsWith('http://') || address.startsWith('https://')); 505 505 const isPeekUrl = address && address.startsWith('peek://'); 506 - const isBackgroundPage = address && (address.includes('background.html') || address.includes('extension-host.html')); 506 + const isBackgroundPage = address && address.includes('background.html'); 507 507 const isReopenable = (isWebUrl || (isPeekUrl && !isBackgroundPage)) && !!address; 508 508 const isContentRole = !role || role === 'content' || role === 'child-content' || role === 'workspace'; 509 509
+3 -6
backend/electron/protocol.ts
··· 575 575 576 576 // Backwards-compat: peek://cmd/{path} resolves to app/cmd/ 577 577 // cmd used to be a consolidated extension served from features/cmd/; it's 578 - // now core app code in app/cmd/. The extension-host iframe still uses this 579 - // origin (peek://cmd/background.html) for isolation. 578 + // now core app code in app/cmd/. 580 579 if (host === 'cmd') { 581 580 const cmdPath = pathname || 'background.html'; 582 581 const absolutePath = path.resolve(rootDir, 'app', 'cmd', cmdPath); ··· 591 590 592 591 // Backwards-compat: peek://hud/{path} resolves to app/hud/ 593 592 // HUD used to be a consolidated extension served from features/hud/; it's 594 - // now core app code in app/hud/. The extension-host iframe uses this 595 - // origin (peek://hud/background.html) for isolation. 593 + // now core app code in app/hud/. 596 594 if (host === 'hud') { 597 595 const hudPath = pathname || 'background.html'; 598 596 const absolutePath = path.resolve(rootDir, 'app', 'hud', hudPath); ··· 607 605 608 606 // Backwards-compat: peek://page/{path} resolves to app/page/ 609 607 // page used to be a consolidated extension served from features/page/; it's 610 - // now core app code in app/page/. The extension-host iframe uses this 611 - // origin (peek://page/background.html) for isolation. 608 + // now core app code in app/page/. 612 609 if (host === 'page') { 613 610 const pagePath = pathname || 'background.html'; 614 611 const absolutePath = path.resolve(rootDir, 'app', 'page', pagePath);
-11
backend/electron/session.test.ts
··· 1426 1426 if (isDestroyed) return true; 1427 1427 if (!isVisible) return true; 1428 1428 if (url.includes('peek://app/background.html')) return true; 1429 - if (url.includes('peek://app/extension-host.html')) return true; 1430 1429 if (params.modal) return true; 1431 1430 if (params.role === 'utility' && params.focusable === false) return true; 1432 1431 return false; ··· 1480 1479 false 1481 1480 ); 1482 1481 assert.strictEqual(skip, true, 'Background window should be skipped'); 1483 - }); 1484 - 1485 - it('skips extension host window', () => { 1486 - const skip = shouldSkipWindow( 1487 - 'peek://app/extension-host.html', 1488 - {}, 1489 - true, 1490 - false 1491 - ); 1492 - assert.strictEqual(skip, true, 'Extension host should be skipped'); 1493 1482 }); 1494 1483 1495 1484 it('skips invisible windows', () => {
+3 -8
backend/electron/session.ts
··· 174 174 continue; 175 175 } 176 176 177 - // Skip the extension host 178 - if (url.includes('peek://app/extension-host.html')) { 179 - continue; 180 - } 181 - 182 177 // Skip modal windows 183 178 if (winData.params.modal) { 184 179 continue; ··· 297 292 for (const descriptor of windowDescriptors) { 298 293 const isWebUrl = descriptor.url.startsWith('http://') || descriptor.url.startsWith('https://'); 299 294 const isPeekUrl = descriptor.url.startsWith('peek://'); 300 - const isBackgroundPage = descriptor.url.includes('background.html') || descriptor.url.includes('extension-host.html'); 295 + const isBackgroundPage = descriptor.url.includes('background.html'); 301 296 const isReopenable = isWebUrl || (isPeekUrl && !isBackgroundPage); 302 297 if (!isReopenable) continue; 303 298 ··· 331 326 DEBUG && console.log(`[session] Pushed ${windowDescriptors.filter(d => { 332 327 const isWeb = d.url.startsWith('http://') || d.url.startsWith('https://'); 333 328 const isPeek = d.url.startsWith('peek://'); 334 - const isBg = d.url.includes('background.html') || d.url.includes('extension-host.html'); 329 + const isBg = d.url.includes('background.html'); 335 330 return isWeb || (isPeek && !isBg); 336 331 }).length} open window(s) to closed window stack`); 337 332 } ··· 885 880 if (!win || win.isDestroyed() || !win.isVisible()) continue; 886 881 887 882 const rawUrl = win.webContents.getURL(); 888 - if (rawUrl.includes('peek://app/background.html') || rawUrl.includes('peek://app/extension-host.html')) continue; 883 + if (rawUrl.includes('peek://app/background.html')) continue; 889 884 890 885 // Check if this window is in space mode 891 886 let modeEntry;
-2
features/windows/windows.js
··· 191 191 if (url.includes('windows.html')) return false; 192 192 // Skip background pages 193 193 if (url.includes('background.html')) return false; 194 - // Skip extension host 195 - if (url.includes('extension-host.html')) return false; 196 194 // Include everything else (content windows and peek:// UI pages) 197 195 return true; 198 196 });
+1 -1
tests/desktop/izui-behavior.spec.ts
··· 42 42 expect(groupsListBefore.params.parentWindowId).toBeNull(); 43 43 44 44 // Step 2: Open a child window FROM the groups content window. 45 - // Since groups/home.html is a real content window (not background/extension-host), 45 + // Since groups/home.html is a real content window (not the background renderer), 46 46 // the child should get parentWindowId set to the groups window's ID. 47 47 const childResult = await groupsWindow.evaluate(async () => { 48 48 return await (window as any).app.window.open('https://child-parent-test.example.com', {