Cordova / Capacitor
Investigate Capacitor and Ionic app behavior with session evidence and inspection across the WebView DOM and native UI.
Follow an issue from the WebView interface into the app’s JavaScript and native evidence. Ansight lets developers and agents review session activity and inspect both DOM and native UI state in supported Capacitor apps.
@ansight/capacitor brings the native Ansight iOS and Android runtimes to Cordova-family web-view applications built with Capacitor. It exposes telemetry, enrollment, screenshots, touch capture, durable native crash recovery, network capture, purchase diagnostics, logs, artifacts, guarded native tools including Clipboard, DOM inspection, route tracking, lifecycle tracking, and JavaScript error capture through one TypeScript API.
The Cordova-family Capacitor SDK currently targets Capacitor 8; classic Apache Cordova projects should not assume drop-in compatibility until a dedicated adapter is available.
Open your app repository in a coding agent and send this prompt:
Copyable prompt:
Use https://www.ansight.ai/skills/cordova/ansight-install-cordova.md to install Ansight in this Capacitor app. Keep it in a development build, verify a connected session, and show me the changes.
The setup guide has the manual steps.
Quick Start
npm install @ansight/capacitor@latest
npx cap sync
import Ansight from "@ansight/capacitor";
export async function startAnsight(isDevelopmentBuild: boolean): Promise<void> {
if (!isDevelopmentBuild) {
return;
}
await Ansight.initializeAndActivate(
Ansight.createOptionsBuilder()
.withAnsightDefaults()
.withReadOnlyToolAccess()
.withDomTools()
.withErrorCapture()
.build(),
);
}
The native simulator or emulator registers automatically with the local CLI
host. Call enrollFromQrCode(...) only from a developer-only screen on a
physical device.
For the complete guarded startup, stable DOM id example, and CLI verification flow, use Cordova / Capacitor Setup.
Use Cordova / Capacitor Packages for package and platform compatibility details.
UI Inspection
dom.*tools inspect the HTML document rendered inside the app WebView.- Native
ui.*tools inspect the surrounding UIKit or Android view hierarchy. - Optional
dom.invoke_actioncan click, focus, blur, or set control values under write access.
Use Cordova / Capacitor Security before putting the package, enrollment UI, DOM inspection, or broad native tools in a distributable build.
See Network Capture for opt-in fetch and XHR
evidence, Clipboard Tools for native clipboard access,
and Purchase Diagnostics for simulator/emulator-only
StoreKit and Google Play validation.
Use Connectivity Capture to record OS connection state, transport changes, and supported quality estimates. See Native Offline Capture for disconnected recording and host transfer across mobile SDKs, implemented after SDK 1.8.0.
Use Capacitor Motion Capture to forward shakes and accelerometer samples from app-owned handlers.