Skip to content

Support real tabs or windows for WebExtension tab APIs #38

Description

@culpen90

Why

Quartz currently presents itself to WebExtension APIs as a single window with a single active tab. openNewTabUsing loads URLs into the current browser surface and the WKWebExtensionWindow / WKWebExtensionTab implementations return self. That keeps the first extension bridge small, but many extensions expect real tab/window behavior.

Where to start

  • Sources/Quartz/QuartzApp.swift
  • Sources/Quartz/QuartzWebExtensionSupport.swift
  • webExtensionController(_:openNewTabUsing:for:completionHandler:)
  • WKWebExtensionWindow and WKWebExtensionTab conformance

Suggested approach

Design the smallest native tab/window model that improves extension compatibility. This could be a tab strip, separate browser windows, or an internal tab representation that can grow into visible tabs later. The important part is that WebExtension APIs can reason about distinct tabs instead of a single self tab.

Acceptance criteria

  • Opening a new tab from an extension does not overwrite the current page unexpectedly.
  • Quartz can report multiple tabs/windows to WebExtension APIs when more than one exists.
  • The active tab and tab URL returned to extensions match the visible browser state.
  • Existing single-window browsing still works.
  • swift build succeeds.

Testing

  • Use an extension that opens a new tab/window.
  • Confirm the current page remains available.
  • Confirm extension popups/actions still target the active visible page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions