Jump to content

Auto.WebNav/UPGRADING

From MindAttic Docs

Upgrading AutoWebNav

AutoWebNav bumps its major version by one for every release, whether or not the change breaks a consumer (Directory.Build.props: "Whole-number versioning: major-only bumps"). NuGet caches a package by version, so a consumer only sees a change after it raises its own PackageReference version. This page lists, for each major version since the library was extracted from Automata, what changed and what a consumer must do about it. Current version: 5.0.0.

Moving to 5.0.0

Commit 296b774 (AWN-T15).

What changed: OffscreenWebView2Factory now wires NewWindowRequested on every off-screen WebView2 controller it creates. A page that opens target="_blank" or calls window.open() used to fall back to WebView2's own default behaviour — a real, visible, normally-positioned popup window outside the factory's control, which could steal focus. Now the request is handled and the URL is navigated inside the same off-screen surface instead, so it never produces a visible window.

Public API: unchanged. No type, member or signature was added, removed or changed.

What a consumer must change: nothing to compile or call differently. If a consumer's own code (or a site it drives) relied on that popup actually appearing as a separate native window — for example to find and screenshot it, or to drive it as a second WebView2 host — that code stops working, because the popup no longer exists; the navigation now happens inside the original off-screen surface and its content shows up there instead. No known consumer did this.

Moving to 4.0.0

Commit b1642b5.

What changed: SessionRecording.Flush writes the session recording file through MindAttic.Export's ArtifactWriter.WriteTextAsync (atomic, Existing = Overwrite, SanitizeName = false) instead of writing to a .tmp file and renaming it by hand. The file name now comes from ArtifactNames.Timestamped. Output is unchanged: the same folder (KnownFolders.Downloads unless overridden), the same name (<App>-session-<yyyyMMdd-HHmmss>.autowebnav-recording.json), and byte-identical UTF-8 (no BOM) JSON content.

Public API: unchanged. SessionRecording's constructor, AttachAsync and Dispose all keep their existing signatures and behaviour.

New dependency: AutoWebNav.WebView2 now carries a PackageReference on MindAttic.Export 3.0.0 and pulls it in transitively.

What a consumer must change: nothing in its own code. The only requirement is that MindAttic.Export 3.0.0 (or a compatible version) be resolvable from wherever the consumer restores packages (the same local feed, C:\LocalNuGet, that AutoWebNav.WebView2 itself is packed to) — if the consumer's own NuGet.config doesn't already list that feed, add it, or restore will fail on the new transitive dependency.

Moving to 3.0.0

Commit 4d6ad24.

What changed: two new types were added to AutoWebNav.WebView2:

  • LiveObservation — one per host app. Opens a local CDP port per WebView2 browser process and registers the app, its PID and its panes' ports in %LocalAppData%\MindAttic\AutoWebNav\instances\<App>-<PID>.json, so an external observer (tools/awn-observe.mjs, added in this version) can attach to the running app. Also gives the house window title, WindowTitle ("<App> - PID: <n>"). A page may expose window.__awnObserve = () => ({ running, summary, log }) so an observer sees the app's own view of itself; a consumer with a control panel page can add this, but doesn't have to.
  • SessionRecording — Spectator Mode, always on once attached to a pane. Every click, typed value (passwords masked), selection, upload and navigation — by the person or by automation — is saved to Downloads as <App>-session-<yyyyMMdd-HHmmss>.autowebnav-recording.json, rewritten every 30 seconds while something changed and once more on close.

AutoWebNav/Scripts/recorder.js changed so the page recorder captures while either an explicit RecorderSession arm or an attached SessionRecording is on; the two no longer turn each other off.

Public API: additive only. Nothing existing was removed or changed; IBrowserSurface, WebView2BrowserSurface, BrowserActions, FingerprintResolver, RecorderSession and RecordingBuilder/RecordingExport are unchanged.

What a consumer must change: nothing is required to keep building or running. To adopt Live Observation and always-on session recording, construct a LiveObservation and a SessionRecording per host app, use observation.OptionsFor(pane, preferredPort) when creating the CoreWebView2Environment, call sessionRecording.AttachAsync(pane, coreWebView2, installToolkit: false) for each pane (installToolkit: false because a WebView2BrowserSurface already installs the page toolkit), and dispose both when the app's window closes. See docs/overview.md ("Live Observation", "Recording (Spectator Mode)") for the full adoption snippet.

See also

  • overview.md — current API, features and the project layout.
  • RELEASE.md — the 5.0 release charter this guide is a deliverable of (AWN2-T12).
Part of Auto.WebNav.
From Auto.WebNav/docs/UPGRADING.md via MindAttic.Docs; synced automatically, so edit the repo, not this page.