docs: fix editor example to use grep and proper URL/string format
This commit is contained in:
@@ -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:**
|
||||
|
||||
Reference in New Issue
Block a user