openai/skills

playwright-interactive

复用同一个浏览器会话反复排查界面

  • SKILL.md 已保存
  • 中文用法已整理
  • 安装与运行未实测
先判断是否解决你的问题

playwright-interactive 是什么?

通过持久JavaScript REPL保留Playwright的浏览器、页面和Electron句柄,适合修改界面后反复重载、操作和截图。它将功能行为、视觉表现和视口可见性分别检查,避免每轮从头启动浏览器。

中文说明由本站依据来源整理;英文原文保留在页面下方。

适合用在

  • 开发者需要在浏览器或 Electron 中反复修改、重载、操作和截图,希望保留 js_repl 会话与页面句柄加快迭代。

这些情况不适合

  • 只需要一次性命令行浏览器自动化;此版本重点是持久交互会话和快速 UI 调试。
按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 playwright-interactive,然后按本页使用示例提供材料。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 playwright-interactive

请在 Codex 的当前工作环境中安装并检查 playwright-interactive 这个 Skill。

项目身份:openai/skills / playwright-interactive
来源:https://github.com/openai/skills/blob/49f948faa9258a0c61caceaf225e179651397431/skills/.curated/playwright-interactive/SKILL.md
已定位的源文件:skills/.curated/playwright-interactive/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
准备输入,再按步骤执行

装好以后,具体怎么用?

准备哪些材料

  • 需要本版本要求的js_repl能力、项目可用的playwright及实际运行环境;网页需有本地服务,Electron需明确入口和工作目录。

会得到什么

  • 对应功能与状态的操作记录、截图和视口检查,以及未覆盖项目。

实际使用顺序

  1. 先列要核对的用户功能、控件状态和视觉证据,初始化持久句柄并启动正确运行时。
  2. 网页或renderer修改重载现有页面;Electron主进程/preload变化则重启应用,不能用旧进程验收新代码。
  3. 通过真实鼠标键盘完成操作,再单独检查桌面/窄屏截图与必要区域边界;截图坐标按CSS像素规范化,结束时关闭自建会话或说明保留原因。
使用示例

从一个具体任务开始

本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。

安装并识别 Skill 后发送

复制一个具体任务

教学示例:用playwright-interactive检查我的本地设置页。先列主题切换、保存提示和390px布局三个检查点,复用同一个页面分别切换再恢复。只允许修改测试环境设置,不操作生产账号;renderer修改后重载。分别记录功能结果与截图观察,不凭scrollWidth正常就宣布无裁切。
预期结果

预期得到指定控件和视口的分别检查;本站未执行。

使用前先看这些限制

使用条件与边界

  • 该版本js_repl和沙箱前提属于所绑定环境,不能当作所有Codex会话的通用配置;先确认当前工具是否真的可调用。
针对这个 Skill 的疑问

常见问题

与playwright CLI版有何区别?

CLI版按快照引用操作;此版在持久REPL中保留浏览器与Electron对象,便于反复调试,依赖与运行条件不同。

为什么不每次reset REPL?

reset会销毁现有句柄与会话状态,应只作为恢复手段,常规迭代优先重载或局部重建句柄。

需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
中文使用说明
已针对下方源文件版本整理用途、用法和常见问题
安装与任务测试
本站未执行安装或任务测试
来源复核
本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料

skills/.curated/playwright-interactive/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Persistent browser and Electron interaction through `js_repl` for fast iterative UI debugging.

查看源文件章节 / Source sections
  • 原文:Playwright Interactive Skill
  • 原文:Preconditions
  • 原文:One-time setup
  • 原文:Core Workflow
  • 原文:Bootstrap (Run Once)
  • 原文:Choose Session Mode
  • 原文:Start or Reuse Web Session
  • 原文:Desktop Web Context
  • 原文:Mobile Web Context
  • 原文:Native-Window Web Pass
  • 原文:Start or Reuse Electron Session
  • 原文:Reuse Sessions During Iteration
  • 原文:Checklists
  • 原文:Session Loop
  • 原文:Reload Decision
  • 原文:Functional QA
  • 原文:Visual QA
  • 原文:Signoff
  • 原文:Screenshot Examples
  • 原文:Model-bound screenshots (default)
  • 原文:Web CSS normalization
  • 原文:Electron CSS normalization
  • 原文:Raw Screenshot Exception Examples
  • 原文:Viewport Fit Checks (Required)
  • 原文:Dev Server
  • 原文:Cleanup
  • 原文:Common Failure Modes
原文:Playwright Interactive Skill

Use a persistent `js_repl` Playwright session to debug local web or Electron apps, keep the same handles alive across iterations, and run functional plus visual QA without restarting the whole toolchain unless the process ownership changed.

原文:Preconditions

- `js_repl` must be enabled for this skill. - If `js_repl` is missing, enable it in `~/.codex/config.toml`: ```toml [features] js_repl = true ``` - You can also start a new session with `--enable js_repl` (equivalent to `-c features.js_repl=true`). - After enabling `js_repl`, start a new Codex session so the tool list refreshes. - For now, run this workflow with sandboxing disabled: start Codex with `--sandbox danger-full-access` (or the equivalent config for `sandbox_mode=danger-full-access`). This is a temporary requirement while `js_repl` + Playwright support inside the sandbox is still being completed. - Run setup from the same project directory you need to debug. - Treat `js_repl_reset` as a recovery tool, not routine cleanup. Resetting the kernel destroys your Playwright handles.

原文:One-time setup

```bash test -f package.json || npm init -y npm install playwright # Web-only, for headed Chromium or mobile emulation: # npx playwright install chromium # Electron-only, and only if the target workspace is the app itself: # npm install --save-dev electron node -e "import('playwright').then(() => console.log('playwright import ok')).catch((error) => { console.error(error); process.exit(1); })" ``` If you switch to a different workspace later, repeat setup there.

原文:Core Workflow

1. Write a brief QA inventory before testing: - Build the inventory from three sources: the user's requested requirements, the user-visible features or behaviors you actually implemented, and the claims you expect to make in the final response. - Anything that appears in any of those three sources must map to at least one QA check before signoff. - List the user-visible claims you intend to sign off on. - List every meaningful user-facing control, mode switch, or implemented interactive behavior. - List the state changes or view changes each control or implemented behavior can cause. - Use this as the shared coverage list for both functional QA and visual QA. - For each claim or control-state pair, note the intended functional check, the specific state where the visual check must happen, and the evidence you expect to capture. - If a requirement is visually central but subjective, convert it into an observable QA check instead of leaving it implicit. - Add at least 2 exploratory or off-happy-path scenarios that could expose fragile behavior. 2. Run the bootstrap cell once. 3. Start or confirm any required dev server in a persistent TTY session. 4. Launch the correct runtime and keep reusing the same Playwright handles. 5. After each code change, reload for renderer-only changes or relaunch for main-process/startup changes. 6. Run functional QA with normal user input. 7. Run a separate visual QA pass. 8. Verify viewport fit and capture the screenshots needed to support your claims. 9. Clean up the Playwright session only when the task is actually finished.

原文:Bootstrap (Run Once)

```javascript var chromium; var electronLauncher; var browser; var context; var page; var mobileContext; var mobilePage; var electronApp; var appWindow; try { ({ chromium, _electron: electronLauncher } = await import("playwright")); console.log("Playwright loaded"); } catch (error) { throw new Error( `Could not load playwright from the current js_repl cwd. Run the setup commands from this workspace first. Original error: ${error}` ); } ``` Binding rules: - Use `var` for the shared top-level Playwright handles because later `js_repl` cells reuse them. - The setup cells below are intentionally short happy paths. If a handle looks stale, set that binding to `undefined` and rerun the cell instead of adding recovery logic everywhere. - Prefer one named handle per surface you care about (`page`, `mobilePage`, `appWindow`) over repeatedly rediscovering pages from the context. Shared web helpers: ```javascript var resetWebHandles = function () { context = undefined; page = undefined; mobileContext = undefined; mobilePage = undefined; }; var ensureWebBrowser = async function () { if (browser && !browser.isConnected()) { browser = undefined; resetWebHandles(); } browser ??= await chromium.launch({ headless: false }); return browser; }; var reloadWebContexts = async function () { for (const currentContext of [context, mobileContext]) { if (!currentContext) continue; for (const p of currentContext.pages()) { await p.reload({ waitUntil: "domcontentloaded" }); } } console.log("Reloaded existing web tabs"); }; ```

原文:Choose Session Mode

For web apps, use an explicit viewport by default and treat native-window mode as a separate validation pass. - Use an explicit viewport for routine iteration, breakpoint checks, reproducible screenshots, snapshot diffs, and model-assisted localization. This is the default because it is stable across machines and avoids host window-manager variability. - When you need deterministic high-DPI behavior, keep the explicit viewport and add `deviceScaleFactor` rather than switching straight to native-window mode. - Use native-window mode (`viewport: null`) for a separate headed pass when you need to validate launched window size, OS-level DPI behavior, browser chrome interactions, or bugs that may depend on the host display configuration. - For Electron, assume native-window behavior all the time. Electron launches through Playwright with `noDefaultViewport`, so treat it like a real desktop window and check the as-launched size and layout before resizing anything. - When signoff depends on both layout breakpoints and real desktop behavior, do both passes: explicit viewport first for deterministic QA, then native-window validation for final environment-specific checks. - Treat switching modes as a context reset. Do not reuse a viewport-emulated `context` for a native-window pass or vice versa; close the old `page` and `context`, then create a new one for the new mode.

文件 SHA256:f6c1155d923e6ae3ccc12abfef2266f119f8e9546df2ddeee1f5eb369845a0a1

仓库许可证记录:未提供;not-established,查看来源。

SKILL.md原文description · 2026-11-16T12:36:35.145Z

Persistent browser and Electron interaction through `js_repl` for fast iterative UI debugging.

查看历史简介来源

历史收录数据

来源仓库openai/skills
Skill源路径skills/.curated/playwright-interactive/SKILL.md

安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源