Contesto del browser
Errori della console, schermate e annotazioni in Studio.
Technical reference synchronized with Yard’s source. File names and development commands refer to the native app repository.
Supported behavior
Console capture is off by default. Enabling it observes console.error, uncaught errors and unhandled
rejections in the current same-origin preview. The original console call retains its receiver and arguments.
There is no cross-frame message receiver and no browser-wide log collection. Cross-origin previews show a
specific unavailable state. Navigating clears previous records.
The review panel displays at most 12 bounded records, including duplicate counts, source URL and available
stack information. URLs omit queries and fragments. Common credential assignments (including prefixed API
keys), authorization values and private-key blocks are redacted. Arbitrary objects, getters, proxies, storage,
cookies and DOM contents are not serialized. Engines without a nontrapping Error.isError brand check omit
error objects; uncaught error events still provide their primitive message and source location. Redaction is
a bounded precaution, not a guarantee that arbitrary application messages cannot contain private information.
Attach errors freezes the displayed diagnostic text for the selected conversation and navigation. New errors require another explicit attachment. Capture alone sends nothing. Switching conversation or preview removes the old attachment, and a completed send does not clear a different conversation's draft.
In external browsers, Attach annotation map sends an explicitly labeled grid containing drawings and selected-element positions, with text, selector, page path, scroll position, viewport and scale context. It uses the DOM already open in the user's browser, including its current authenticated state. Page pixels are not included. Yard does not reload the page into an unauthenticated screenshot renderer or export its cookies. Selected-element markup omits attributes. The drawing remains inspectable before sending.
Native Studio retains the actual WebKit snapshot plus its annotation layer. Requests carry a capture ID, conversation generation, document identity and viewport/scroll stamp. Navigation, resizing or changing owner invalidates pending work; stale callbacks cannot attach to a new request. A timeout restores the controls. Drawings survive the main capture action and are cleared when the preview document changes. The native bridge accepts only the current main Studio document at the session's origin or another registered project origin; callbacks recheck navigation and origin before delivering pixels. Proxy sites without a project directory cannot open these project tools.
Verification
swift test --filter 'StudioHandoffWebTests|PreviewCaptureTests'exercises the shipped JavaScript in WebKit: explicit send payloads, storms/duplicates, redaction, no getters/proxy traps, navigation/conversation boundaries, authenticated DOM, external annotation labeling, native snapshot IDs, actual red drawing pixels and restrictions.YARD_STUDIO_BROWSER_SMOKE=1 node Tests/studio-browser-context-smoke.cjsruns the same bundled resources in installed Chrome with a private headless profile and disposable loopback HTTP servers. Its authenticated cookie fixture verifies actual pointer drawing at scale 2 / scroll 120, an inspectable PNG map, exact outbound message contents, credential redaction and rejection of a foreign-origin iframe. It uses no Yard installation, provider account or model. Evidence is written to a temporaryyard-browser-context-*folder.- Light/dark screenshots and the generated map are visually reviewed. WebKit also exercises external-browser mode, but a separate Safari application session was not automated. Full-page screenshots in external browsers, cross-origin DOM inspection and source-map resolution are outside this contract.
Implementation: preview-context.js, design.js, app.js, StudioWindow.swift; visual styles use existing
Studio color, type, spacing and control patterns. Native installation, services and the live test database are
not changed by these checks.