Skip to content

v0.10.0

Choose a tag to compare

@lynnswap lynnswap released this 13 Nov 13:00
5c09dbe

WebInspectorKit v0.10.0

This release replaces the session, container, and context with one object, WebInspector, and changes the source of every app that uses the built-in UI or WebInspectorDataKit. The migration guide lists each change with its replacement. WebInspectorProxyKit and WebKitRuntime keep their public API.

Breaking Changes

  • WebInspectorViewController presents a WebInspector. WebInspectorSession and WebInspectorSession.prepare() are removed. Create the controller with WebInspectorViewController(tabs:) or WebInspectorViewController(inspector:tabs:), and call controller.inspector.attach(to:) and controller.inspector.detach() in place of the controller's own attach(to:) and detach().
  • attach(to:) and detach() return immediately and no longer throw. Read inspector.state for the progress and for an attachment failure.
  • A custom tab's factory receives the WebInspector instead of the session.
  • WebInspectorContainer and WebInspectorContext are no longer public. inspector.dom, css, network, console, runtime, and page replace the context's properties, and their types are renamed from …ModelController to …Inspector.
  • The inspector and its models are bound to the main actor. Methods no longer take an isolation: parameter.
  • State and operations live only on the domain objects. DOMNode, NetworkRequest, and RuntimeObject no longer start commands themselves, and DOM and CSS operations take the DOMNode instead of its ID.
  • NetworkRequestQuery, ConsoleMessageQuery, WebInspectorFetchedResults, WebInspectorFetchedResultsController, and their snapshot, section, and transaction types are removed. Read inspector.network.requests and inspector.console.messages, and filter or sort them in your own model.
  • WebInspectorMutationOptions, WebInspectorUndoPolicy, WebInspectorStaleModelPolicy, DOMMutationResult, WebInspectorEditHistory, and treeController(root:) are removed. WebInspectorPersistentModel is renamed to WebInspectorModel.
  • The element picker applies the latest requested state. Cancelling the calling task no longer restores the earlier state.
  • In WebInspectorDataKitTesting, inspector.attachForTesting(to:) replaces WebInspectorContext.startAndWaitForStartupForTesting().

New Features

  • WebInspector is an observable model that owns the attachment. Keep one for as long as you inspect: attaching to another web view replaces the current attachment, attaching to the web view that is already inspected does nothing, and releasing the inspector ends the attachment. Its domain objects stay valid across attachments.
  • inspector.network.requests and inspector.console.messages are observable collections in arrival order. requestChanges and messageChanges report the inserted, updated, and removed models, and continue across attachments.
  • import WebInspectorKit also provides WebInspector and its models.

Improvements

  • The built-in UI no longer needs a prepare() call before it is shown.
  • You no longer wait for a detach before attaching to another web view. The inspector applies attach and detach calls one at a time, and the latest call decides the result.

Bug Fixes

  • While an inspector is attached, the app's navigation delegate now receives the callbacks that WebInspectorKit does not handle itself, such as the private navigation gesture callbacks. Private callbacks that take a completion handler are still not forwarded.

Full Changelog: v0.9.7...v0.10.0