Skip to content

Route connected web resources through controlling Service Workers #308

Description

@wieslawsoltes

Parent resource issue: #266
Nested-webview epic: #264
Related CSS URL decoding: #286

Proven gap

Merged #303/#304 route explicit Window.fetch() through the claimed Service Worker, but parser and DOM connected-resource loads still call the host text loader directly. <script src>, <link rel="stylesheet">, <img src>, and CSS image loads therefore bypass the controlling worker. Unchanged VS Code's webview prelude supplies its extension script, styles, and images through the v6 Service Worker broker, so explicit-fetch success cannot render Markdown content.

The generic owner is WebScene's connected-resource/request scheduling. CSS escape decoding remains #286 and CSS cascade work remains under #235.

Scope

  • Route same-scope parser and dynamically connected script, stylesheet, image, and CSS image requests through the active controller before any host fallback/cache read.
  • Preserve browser task ordering: script execution then load/error, stylesheet application then load/error, image decode/currentSrc/natural size then load/error.
  • Carry GET URL, origin/referrer, credentials/cookie policy, destination, client identity, and navigation generation into FetchEvent.
  • Keep interception asynchronous so a Service Worker may message its controlled client for bytes without blocking that client's task queue.
  • Fall through only when FetchEvent is not handled. A handled rejection, timeout, malformed/oversized body, non-success status, retired generation, or stopped worker must fail closed and must not reach the host loader.
  • Keep data/blob/object URLs and service-worker bootstrap loading on their existing appropriate paths.

Acceptance

Proposed focused PR

One generic asynchronous connected-resource interception tranche with native/browser contracts and bounded lifecycle/performance evidence. Keep #266 open for HTTP 200/206/304/range/validator security and cumulative product completion.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vscode-oss/plannedPlanned for the AppScene/WebScene VS Code OSS integration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions