Window/BOM Completeness – Missing Browser APIs #124

Open
opened 2026-06-20 08:19:58 +00:00 by Artur · 0 comments
Owner

Gap

Unser OwnWindow hat die wichtigsten APIs (location, navigator, history, timers, crypto, performance). Aber viele Browser APIs fehlen komplett - Seiten die sie feature-detected bekommen undefiniertes Verhalten.

Was fehlt (nach Wichtigkeit)

Kritisch (brechen Seiten wenn nicht vorhanden)

  • window.postMessage() / window.addEventListener('message', ...) / MessageEvent - Cross-Origin-Kommunikation
  • window.open() / window.close() / window.closed - Fenster-Management
  • window.frames / window.length / window[i] - Frame-Indexed-Zugriff
  • window.name - Fenster-Name (wird von manchen Frameworks als State genutzt)
  • window.status - Status-Leiste (legacy, aber oft gelesen)
  • window.opener - Verweis auf oeffnendes Fenster (wichtig für window.opener !== null checks)
  • window.locationbar / window.menubar / window.personalbar / window.scrollbars / window.statusbar / window.toolbar - Chrome-APIs (müssen existieren als Objekte mit .visible getter)

Hoch (Frameworks/APIs nutzen sie)

  • window.caches / window.Cache / window.CacheStorage - Cache API (haben einen Shim, muss spec-konformer)
  • window.scheduler / Scheduler / TaskController / TaskSignal - Prioritized Task Scheduling
  • window.crossOriginIsolated - Cross-Origin-Opener-Policy
  • window.isSecureContext - HTTPS Detection (return true/"https" je nach location.protocol)
  • window.origin - Origin (return location.origin)
  • window.originAgentCluster - Origin Keyed Agent Clustering
  • window.screenLeft / window.screenTop / window.screenX / window.screenY - Screen Position (return 0)
  • window.moveTo() / window.moveBy() / window.resizeTo() / window.resizeBy() - noop
  • window.print() - noop (muss existieren als Funktion)
  • window.getComputedStyle() / window.matchMedia() - existieren, aber muessen auf window
  • window.getSelection() - Selection API (zurueck zu Selection-Objekt mit noop-Methoden)

Mittel (Feature-Detection)

  • window.showDirectoryPicker() / window.showOpenFilePicker() / window.showSaveFilePicker() - File System Access (noop, reject mit AbortError)
  • window.navigator - alle navigator.* APIs (mediaDevices, bluetooth, usb, serial, etc.) muessen als Objekte existieren
  • window.navigator.connection - Network Information (return {effectiveType: '4g', ...})
  • window.navigator.storage / navigator.storage.persist() / navigator.storage.persisted() - Storage API
  • window.BroadcastChannel - Cross-Tab Kommunikation
  • window.Notification / Notification.permission / Notification.requestPermission() - Notification API (return 'default', noop)
  • window.ServiceWorker / navigator.serviceWorker - Service Worker (registered: none)

Niedrig

  • window.speechSynthesis - Speech API (leeres Objekt)
  • window.navigator.share() / navigator.canShare() - Web Share API (noop)
  • window.navigator.credentials / navigator.credentials.create() / navigator.credentials.get() - Credential Management (noop)
  • window.navigator.locks / navigator.locks.request() - Web Locks API
  • window.navigator.mediaSession - Media Session
  • window.navigator.geolocation - Geolocation (noop, error callback)
  • window.navigator.permissions / navigator.permissions.query() - Permissions API (return 'granted' fuer einfache, 'denied' fuer sensitive)
  • window.PaymentRequest / window.PaymentResponse - Payment API (throw NotSupportedError)
  • window.XRSystem / navigator.xr - WebXR (noop)

Labels

feature, html-spec

Architektur

  • src/dom/window.ts wird erweitert
  • src/fakes/ navigator.ts, maps-apis.ts, etc. erweitern
  • Shims in src/fakes/ oder src/bom/ (neu)
  • Jeder Shim: minimale spec-korrekte Implementierung, kein echtes Device-Access

Tests

  • Jede API existiert auf window mit korrektem Typ
  • window.postMessage dispatcht message event
  • window.open return Window-Referenz
  • navigator.subAPIs existieren als Objekte
## Gap Unser OwnWindow hat die wichtigsten APIs (location, navigator, history, timers, crypto, performance). Aber viele Browser APIs fehlen komplett - Seiten die sie feature-detected bekommen undefiniertes Verhalten. ## Was fehlt (nach Wichtigkeit) ### Kritisch (brechen Seiten wenn nicht vorhanden) - `window.postMessage()` / `window.addEventListener('message', ...)` / `MessageEvent` - Cross-Origin-Kommunikation - `window.open()` / `window.close()` / `window.closed` - Fenster-Management - `window.frames` / `window.length` / `window[i]` - Frame-Indexed-Zugriff - `window.name` - Fenster-Name (wird von manchen Frameworks als State genutzt) - `window.status` - Status-Leiste (legacy, aber oft gelesen) - `window.opener` - Verweis auf oeffnendes Fenster (wichtig für window.opener !== null checks) - `window.locationbar` / `window.menubar` / `window.personalbar` / `window.scrollbars` / `window.statusbar` / `window.toolbar` - Chrome-APIs (müssen existieren als Objekte mit .visible getter) ### Hoch (Frameworks/APIs nutzen sie) - `window.caches` / `window.Cache` / `window.CacheStorage` - Cache API (haben einen Shim, muss spec-konformer) - `window.scheduler` / `Scheduler` / `TaskController` / `TaskSignal` - Prioritized Task Scheduling - `window.crossOriginIsolated` - Cross-Origin-Opener-Policy - `window.isSecureContext` - HTTPS Detection (return true/"https" je nach location.protocol) - `window.origin` - Origin (return location.origin) - `window.originAgentCluster` - Origin Keyed Agent Clustering - `window.screenLeft` / `window.screenTop` / `window.screenX` / `window.screenY` - Screen Position (return 0) - `window.moveTo()` / `window.moveBy()` / `window.resizeTo()` / `window.resizeBy()` - noop - `window.print()` - noop (muss existieren als Funktion) - `window.getComputedStyle()` / `window.matchMedia()` - existieren, aber muessen auf window - `window.getSelection()` - Selection API (zurueck zu Selection-Objekt mit noop-Methoden) ### Mittel (Feature-Detection) - `window.showDirectoryPicker()` / `window.showOpenFilePicker()` / `window.showSaveFilePicker()` - File System Access (noop, reject mit AbortError) - `window.navigator` - alle navigator.* APIs (mediaDevices, bluetooth, usb, serial, etc.) muessen als Objekte existieren - `window.navigator.connection` - Network Information (return {effectiveType: '4g', ...}) - `window.navigator.storage` / `navigator.storage.persist()` / `navigator.storage.persisted()` - Storage API - `window.BroadcastChannel` - Cross-Tab Kommunikation - `window.Notification` / `Notification.permission` / `Notification.requestPermission()` - Notification API (return 'default', noop) - `window.ServiceWorker` / `navigator.serviceWorker` - Service Worker (registered: none) ### Niedrig - `window.speechSynthesis` - Speech API (leeres Objekt) - `window.navigator.share()` / `navigator.canShare()` - Web Share API (noop) - `window.navigator.credentials` / `navigator.credentials.create()` / `navigator.credentials.get()` - Credential Management (noop) - `window.navigator.locks` / `navigator.locks.request()` - Web Locks API - `window.navigator.mediaSession` - Media Session - `window.navigator.geolocation` - Geolocation (noop, error callback) - `window.navigator.permissions` / `navigator.permissions.query()` - Permissions API (return 'granted' fuer einfache, 'denied' fuer sensitive) - `window.PaymentRequest` / `window.PaymentResponse` - Payment API (throw NotSupportedError) - `window.XRSystem` / `navigator.xr` - WebXR (noop) ## Labels feature, html-spec ## Architektur - src/dom/window.ts wird erweitert - src/fakes/ navigator.ts, maps-apis.ts, etc. erweitern - Shims in src/fakes/ oder src/bom/ (neu) - Jeder Shim: minimale spec-korrekte Implementierung, kein echtes Device-Access ## Tests - Jede API existiert auf window mit korrektem Typ - window.postMessage dispatcht message event - window.open return Window-Referenz - navigator.subAPIs existieren als Objekte
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
glow-all/true-headless-browser#124
No description provided.