Repository navigation
v0.10.0
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
WebInspectorViewControllerpresents aWebInspector.WebInspectorSessionandWebInspectorSession.prepare()are removed. Create the controller withWebInspectorViewController(tabs:)orWebInspectorViewController(inspector:tabs:), and callcontroller.inspector.attach(to:)andcontroller.inspector.detach()in place of the controller's ownattach(to:)anddetach().attach(to:)anddetach()return immediately and no longer throw. Readinspector.statefor the progress and for an attachment failure.- A custom tab's factory receives the
WebInspectorinstead of the session. WebInspectorContainerandWebInspectorContextare no longer public.inspector.dom,css,network,console,runtime, andpagereplace the context's properties, and their types are renamed from…ModelControllerto…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, andRuntimeObjectno longer start commands themselves, and DOM and CSS operations take theDOMNodeinstead of its ID. NetworkRequestQuery,ConsoleMessageQuery,WebInspectorFetchedResults,WebInspectorFetchedResultsController, and their snapshot, section, and transaction types are removed. Readinspector.network.requestsandinspector.console.messages, and filter or sort them in your own model.WebInspectorMutationOptions,WebInspectorUndoPolicy,WebInspectorStaleModelPolicy,DOMMutationResult,WebInspectorEditHistory, andtreeController(root:)are removed.WebInspectorPersistentModelis renamed toWebInspectorModel.- The element picker applies the latest requested state. Cancelling the calling task no longer restores the earlier state.
- In WebInspectorDataKitTesting,
inspector.attachForTesting(to:)replacesWebInspectorContext.startAndWaitForStartupForTesting().
New Features
WebInspectoris 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.requestsandinspector.console.messagesare observable collections in arrival order.requestChangesandmessageChangesreport the inserted, updated, and removed models, and continue across attachments.import WebInspectorKitalso providesWebInspectorand 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