docs: fix editor example to use grep and proper URL/string format

This commit is contained in:
Tommy D. Rossi
2026-01-24 15:25:09 +01:00
parent 157c3a62d6
commit d64229c1ab
+2 -1
View File
@@ -89,7 +89,8 @@ playwriter -e "await state.dbg.setBreakpoint({ file: state.scripts[0].url, line:
**Live edit page code:**
```bash
playwriter -e "state.cdp = await getCDPSession({ page }); state.editor = createEditor({ cdp: state.cdp }); await state.editor.enable()"
playwriter -e "await state.editor.edit({ url: 'app.js', oldString: 'DEBUG=false', newString: 'DEBUG=true' })"
playwriter -e "state.matches = await state.editor.grep({ regex: /DEBUG/ }); console.log(state.matches)"
playwriter -e "await state.editor.edit({ url: state.matches[0].url, oldString: 'const DEBUG = false', newString: 'const DEBUG = true' })"
```
**Screenshot with labels:**