Skip to content

Implement URL.parse and URL.canParse for Code OSS browser consumers #768

Description

@wieslawsoltes

Merged implementation checkpoint — 20 September 2026

Exact heads: WebScene main 5e24b469e28cd19259a2853fa44a45fa02bbfb45, AppScene main 773e94e26b58eac423ca24d5e47bea172965c94c, unchanged Code OSS 645f29cc3176500b4b5762ba887cf2a7f0ffdf2c, local vscode-demo 2e6012d520ede98126777ffebffe86aef1780f8a (clean, 305 commits ahead, intentionally unpushed), WebScene consolidation #76 29ba147ef83fceb6c981d94698e29e7619417fce, and AppScene consolidation #65 0702d52e37d0a1aeeac6956092c5b241a9c05beb. Repository Actions remain disabled.

PR #769 merged at WebScene main 5e24b469e28cd19259a2853fa44a45fa02bbfb45. Implementation commit 24c18362906da7314eeda6e1af12f7eafb7afad5 adds allocation-bounded URL.parse() and URL.canParse() in main and iframe realms for unchanged Browser View, Chat, MCP, agent-session, and session-artifact consumers. Ledger commit 01b980bbf32c331ad691ed8d8ac5930f7441d827 records the scope.

Native/browser gates were authored but not executed. The enclosing URL parser remains explicitly partial, and exact-package consumer acceptance stays under #260/#261/#263/#264.

Parent capability ledger: #263
Product consumers: #260 and #261
Webview/browser surface: #264

Proven gap

Unchanged Code OSS 1.137 directly calls URL.parse() and URL.canParse() in browser-reachable Browser View, Chat question validation, MCP elicitation, agent-session input, and session-artifact paths. WebScene's main and iframe WebSceneURL classes currently expose only the constructor plus object-URL helpers, so these calls fail with a missing-function TypeError.

Representative unchanged sources include:

  • src/vs/workbench/contrib/browserView/common/browserView.ts
  • src/vs/workbench/contrib/mcp/browser/mcpElicitationService.ts
  • src/vs/workbench/contrib/chat/common/chatService/chatQuestionCarouselHelpers.ts
  • src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.ts
  • src/vs/sessions/contrib/chat/browser/sessionArtifacts.ts

Focused implementation

  • Add browser-shaped URL.canParse(url, base?) and URL.parse(url, base?) static methods in main and iframe realms.
  • Require the URL argument, convert inputs consistently, accept absolute supported schemes, allow relative input only with a valid absolute base, reject invalid special-scheme authorities, and return null from parse for parse failure.
  • Keep object-URL behavior and unchanged Code OSS intact.
  • Add bounded native/browser contracts for method shape, absolute/relative inputs, invalid inputs, special and non-special schemes, optional bases, main/iframe parity, and conversion failures.

The current URL constructor remains a deliberately partial parser; this issue closes the missing static consumer surface without claiming full WHATWG URL conformance.

Deferred acceptance

Focused gates are authored with the implementation. Execution and exact-package Browser View, Chat, MCP, and session-artifact acceptance remain under #263/#260/#261/#264 and the active throughput directive.

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