mirror of
https://github.com/CloakHQ/CloakBrowser.git
synced 2026-06-23 11:41:46 +02:00
Adds js/ package mirroring the Python wrapper architecture: - Dual API: import from 'cloakbrowser' (Playwright) or 'cloakbrowser/puppeteer' - TypeScript with full type definitions - Same binary download/cache logic, same stealth args, same env vars - Optional peer deps: users install only the runtime they need - Full 6-site stealth test suite (sannysoft, incolumitas, BrowserScan, deviceandbrowserinfo, FingerprintJS, reCAPTCHA v3) - Published to npm as cloakbrowser@0.1.2
19 lines
455 B
TypeScript
19 lines
455 B
TypeScript
/**
|
|
* Basic CloakBrowser example using Playwright API.
|
|
*
|
|
* Usage:
|
|
* CLOAKBROWSER_BINARY_PATH=/path/to/chrome npx tsx examples/basic-playwright.ts
|
|
*/
|
|
|
|
import { launch } from "../src/index.js";
|
|
|
|
const browser = await launch({ headless: true });
|
|
const page = await browser.newPage();
|
|
|
|
await page.goto("https://example.com");
|
|
console.log(`Title: ${await page.title()}`);
|
|
console.log(`URL: ${page.url()}`);
|
|
|
|
await browser.close();
|
|
console.log("Done.");
|