From 696895e7ebe53450b0173a434513ecc137fbcfcf Mon Sep 17 00:00:00 2001 From: j-mendez Date: Thu, 8 Feb 2024 14:09:29 -0500 Subject: [PATCH] chore(kayle): allow all intercept cdp --- kayle/lib/config.ts | 4 ++-- kayle/lib/index.ts | 2 +- kayle/lib/utils/go-to-page.ts | 2 ++ kayle/package.json | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/kayle/lib/config.ts b/kayle/lib/config.ts index f3154f0b..0ab55dd2 100644 --- a/kayle/lib/config.ts +++ b/kayle/lib/config.ts @@ -57,7 +57,7 @@ type Browser = { type Target = {}; // dom lifecycles -type LifeCycleEvent = +export type LifeCycleEvent = | "load" | "domcontentloaded" // playwright @@ -69,7 +69,7 @@ type LifeCycleEvent = | "networkidle2"; // wait for options -type WaitForOptions = { +export type WaitForOptions = { timeout?: number; waitUntil?: LifeCycleEvent | LifeCycleEvent[] | string; }; diff --git a/kayle/lib/index.ts b/kayle/lib/index.ts index 2eb4ae23..b68f1680 100644 --- a/kayle/lib/index.ts +++ b/kayle/lib/index.ts @@ -11,5 +11,5 @@ export { sendCDPPageConfigurationEnable, sendCDPPageConfigurationReset, } from "./utils/cdp-blocking"; -export { setLogging, Standard, RunnerConfig, Runner } from "./config"; +export { setLogging, Standard, type RunnerConfig, type Runner, type LifeCycleEvent, type WaitForOptions } from "./config"; export { extractLinks, innateBuilder } from "./wasm"; diff --git a/kayle/lib/utils/go-to-page.ts b/kayle/lib/utils/go-to-page.ts index ddf2b095..13b4262d 100644 --- a/kayle/lib/utils/go-to-page.ts +++ b/kayle/lib/utils/go-to-page.ts @@ -35,7 +35,9 @@ export const goToPage = async ( o: Partial ): Promise => { await setCDPIntercept(o); + const { page, timeout, waitUntil, origin } = o; + let valid = false; try { diff --git a/kayle/package.json b/kayle/package.json index 88bb6892..7d3a4540 100644 --- a/kayle/package.json +++ b/kayle/package.json @@ -1,6 +1,6 @@ { "name": "kayle", - "version": "0.8.2", + "version": "0.8.6", "description": "Extremely fast and accurate accessibility engine built for any headless tool like playwright or puppeteer.", "main": "./build/index.js", "keywords": [