Skip to content

__CAPGO_KEEP_0__

GitHub

AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. AI 도구에 다음 명령어를 사용하여 Capgo 스킬을 추가하세요:

터미널 창
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

다음 명령어를 사용하여 다음 프롬프트를 사용하세요:

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-webview-guardian` plugin in my project.

만약 Manual Setup을 선호한다면, 플러그인을 설치하기 위해 다음 명령어를 실행하고 아래에 플랫폼에 따라 설명된 지침을 따르세요:

터미널 창
bun add @capgo/capacitor-webview-guardian
bunx cap sync
import { WebviewGuardian } from '@capgo/capacitor-webview-guardian';

전경 이벤트를 관찰하고 WebView의 건강을 자동으로 확인합니다.

import { WebviewGuardian } from '@capgo/capacitor-webview-guardian';
await WebviewGuardian.startMonitoring();

전경 이벤트의 자동 관찰을 중지합니다.

import { WebviewGuardian } from '@capgo/capacitor-webview-guardian';
await WebviewGuardian.stopMonitoring();

__CAPGO_KEEP_2__

import { WebviewGuardian } from '@capgo/capacitor-webview-guardian';
await WebviewGuardian.getState();

__CAPGO_KEEP_3__

import { WebviewGuardian } from '@capgo/capacitor-webview-guardian';
await WebviewGuardian.checkNow();

__CAPGO_KEEP_4__

__CAPGO_KEEP_5__

StartMonitoringOptions

__CAPGO_KEEP_6__
export interface StartMonitoringOptions {
/**
* Delay (in ms) before running a health check after the app re-enters the foreground.
* Defaults to 600ms to let the bridge finish resuming.
*/
foregroundDebounceMs?: number;
/**
* Script executed via `evaluateJavascript`/`evaluateJavaScript` to confirm the WebView is alive.
* Defaults to `document.readyState`.
*/
pingScript?: string;
/**
* Automatically reloads the WebView when a terminated render process is detected.
* Disable to receive `webviewCrashed` events and restart manually.
*/
autoRestart?: boolean;
/**
* Strategy used when restarting the WebView. Defaults to `reload`.
*/
restartStrategy?: RestartStrategy;
/**
* Custom HTTPS/HTTP URL to load when `restartStrategy` is `customUrl`.
*/
customRestartUrl?: string;
/**
* Emits verbose logging in the native layer when true.
*/
debug?: boolean;
/**
* Whether an immediate health check should be executed right after enabling monitoring.
* Defaults to `true`.
*/
runInitialCheck?: boolean;
}

GuardianState

__CAPGO_KEEP_7__
export interface GuardianState {
monitoring: boolean;
reason: string;
timestamp: string;
lastHealthyAt?: string;
lastRestartAt?: string;
lastCrashAt?: string;
pendingRestartReason?: string;
error?: string;
}

CheckNowOptions

CheckNowOptions 섹션
export interface CheckNowOptions {
/**
* Text tag describing why a manual check is being requested.
*/
reason?: string;
}
export interface CheckResult {
healthy: boolean;
restarted: boolean;
reason: string;
timestamp: string;
error?: string;
pendingRestart?: boolean;
}
export type GuardianEvent = GuardianState;

RestartStrategy

RestartStrategy 섹션
export type RestartStrategy = 'reload' | 'reloadFromOrigin' | 'customUrl';

실제 데이터 원천

실제 데이터 원천 섹션

이 페이지는 플러그인의 설정에서 생성되었습니다. src/definitions.ts. Re-run the sync when the public API changes upstream.

만약 __CAPGO_KEEP_2__를 사용하고 있다면 Getting Started native 미디어 및 인터페이스 동작을 계획하기 위해 __CAPGO_KEEP_3__에 연결하세요. capgo/capacitor-webview-guardian @capgo/capacitor-webview-guardian을 사용하는 경우 native 기능입니다. capgo/capacitor-live-activities @capgo/capacitor-live-activities를 사용하는 경우 native 기능입니다. capgo/capacitor-live-activities @capgo/capacitor-live-activities를 사용하는 구현 세부 정보입니다. capgo/capacitor-live-activities @capgo/capacitor-live-activities를 사용하는 구현 세부 정보입니다. capgo/capacitor-live-activities @capgo/capacitor-live-activities를 사용하는 구현 세부 정보입니다. capgo/capacitor-live-activities @capgo/capacitor-live-activities를 사용하는 구현 세부 정보입니다. Using @capgo/capacitor-video-player native 기능을 위해 Using @capgo/capacitor-video-player를 사용합니다. Using @capgo/capacitor-video-player native 기능의 구현 세부 사항을 위해 Using @capgo/capacitor-video-player를 사용합니다.