playwright-stealth

Configure Playwright automated browsers to run in a more realistic user-like environment—covering randomized UA/resolution/language/timezone, removal of automation flags, and simulation of plugins and browser features such as Canvas/Audio/WebRTC—to reduce machine-exposed automation fingerprints. Example trigger phrases: playwright fingerprint, hide webdriver, simulate real browser.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "playwright-stealth" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-1eacbf9de15cf19da45ad44029da140728f970defa97f5eaf345fd20a6521824. Verify the upstream source and version against https://skillhub.cn/skills/user_3ff3c268/playwright-stealth before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Configure Playwright automated browsers to run in a more realistic user-like environment—covering randomized UA/resolution/language/timezone, removal of automation flags, and simulation of plugins and browser features such as Canvas/Audio/WebRTC—to reduce machine-exposed automation fingerprints. Example trigger phrases: playwright fingerprint, hide webdriver, simulate real browser.

0 Downloads

Introduction source: third_party · user_3ff3c268 · 1.2.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Translation pending; see source documentation.
Software, accounts and paid services
Translation pending; see source documentation.
Limits and differences
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter


name: playwright-stealth
description: 为 Playwright 自动化浏览器配置「贴近真实用户」的运行环境——随机 UA/分辨率/语言/时区、去除自动化标志、模拟插件与 Canvas/Audio/WebRTC 等浏览器特征,让自动化会话更少暴露机器特征。触发词:playwright 指纹、浏览器自动化指纹、隐藏 webdriver、模拟真实浏览器、自动化环境配置、playwright 反自动化特征、stealth 注入。
market_desc: 为 Playwright 自动化浏览器配置贴近真实用户的环境——随机 UA/分辨率/语言/时区、去除自动化标志、模拟插件与 Canvas/Audio/WebRTC 特征,绕开反爬。适合爬虫、自动化测试,开箱即用。 【闭环归属】本技能是「拟人化浏览器采集闭环」的第 1 步(共 4 步:指纹→去痕→拟人→落地)。要抗检测的采集 Agent,配齐这 4 个技能即可;总控入口:stealth-browser-collector。
version: 1.2.0
display_name: Playwright 反检测环境配置(去 webdriver 痕迹)
changelog: 升级 v1.2.0:中性化署名、场景拓宽、补充闭环归属交叉引用。

playwright-stealth —— Playwright 自动化浏览器环境配置

让 Playwright 自动化会话的运行环境更贴近真实用户,减少机器特征暴露。 抽取自 caijiqi-kaifa/electron/collector/stealth.ts。需 Playwright 运行时(浏览器端注入部分依赖 page 对象)。 内置一份精简 UA / 分辨率样本;生产环境建议搭配 browser-fingerprint-pool(88+ UA / 87 分辨率)使用。

合规说明

本 skill 仅用于让自动化浏览器更接近真实用户的运行环境,属于通用的浏览器环境配置能力,请遵守目标站点的服务条款与相关法律法规,仅用于合规的自动化与测试场景。

适用场景

  • 用 Playwright 做网页自动化 / 采集 / 回归测试时,希望环境更真实、更稳定
  • 需要随机化 UA、视口、语言、时区,并保持这些特征之间自洽(如分辨率与视口一致)
  • 需要补齐 Canvas / WebGL / AudioContext / Plugins / Permissions 等浏览器特征,避免空特征暴露

用法

import { getRandomBrowserConfig, STEALTH_ARGS, IGNORE_DEFAULT_ARGS,
         injectStealthScripts, createStealthContext }
  from './scripts/stealth.mjs';
import { chromium } from 'playwright';

const browser = await chromium.launch({ args: STEALTH_ARGS, ignoreDefaultArgs: IGNORE_DEFAULT_ARGS });

// 方式一:直接拿一份随机且自洽的配置
const cfg = getRandomBrowserConfig('US');
// => { userAgent, viewport:{width,height}, locale, languages, timezoneId }

// 方式二:建一个带注入的上下文(推荐)
const { context, config } = await createStealthContext(browser, 'DE');
const page = await context.newPage();
await page.goto('https://example.com');

核心 API

  • getRandomBrowserConfig(site):按站点返回随机 UA / 视口 / 语言 / 时区的自洽配置(站点支持 US/UK/DE/FR/IT/ES/JP/CA/AU/IN/MX,缺省 US)
  • STEALTH_ARGS:Chromium 启动参数(去除自动化相关标志、关闭后台节流等)
  • IGNORE_DEFAULT_ARGS:需忽略的默认参数(--enable-automation 等)
  • injectStealthScripts(page):向页面注入环境模拟脚本(隐藏 webdriver、模拟插件/Chrome/Canvas/Audio/WebRTC/Permissions/分辨率一致性)。需在浏览器中运行
  • createStealthContext(browser, site, proxy?):创建一个已注入环境模拟的浏览器上下文

注意

  • injectStealthScripts / createStealthContext 必须在 Playwright 浏览器运行时中执行,纯 Node 无法单测这部分;可用 getRandomBrowserConfig / STEALTH_ARGS 验证纯逻辑。
  • 内置 UA / 分辨率仅为精简样本。要更大样本,把 browser-fingerprint-pool 的数据替换进 RANDOM_UAS / RANDOM_RESOLUTIONS 即可。

Current listing version

1.2.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value88/100

Highlights

  • 解决 Playwright 自动化浏览器反检测的核心痛点
  • 提供闭环归属说明,属于「拟人化浏览器采集闭环」生态
  • 面向开发者高频刚需场景,实用价值明确
Trigger Precision95/100

Highlights

  • 触发词覆盖全面,包含 playwright 指纹、隐藏 webdriver、模拟真实浏览器等关键变体
  • 边界清晰,不易误触或漏触
Structure and Standards82/100

Areas to improve

  • 缺少显式 Phase/步骤划分 Reported severity: Minor

    文档未使用 Phase 或 Step 显式划分执行阶段

    Recommendation: 建议补充 Phase 1/2/3 显式步骤划分,提升可读性

  • 缺少 When to Use 显式章节 Reported severity: Minor

    适用场景内容已存在,但未使用标准 When to Use 章节命名

    Recommendation: 建议将「适用场景」改为「When to Use」以符合规范

Highlights

  • frontmatter 完整,含版本号与更新日志
  • 提供端到端代码示例,降低使用门槛
Execution Reliability85/100

Highlights

  • 工具来源明确,参数定义清晰
  • 覆盖主要异常场景(如 injectStealthScripts 必须在浏览器运行时执行)
  • 提供生产环境优化建议(搭配 browser-fingerprint-pool)
Evidence Verifiability (mean of the first four)88/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • example.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Translation pending; see source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.