Skip to content

Configuration not automatically loaded from playwright-cli.json #269

Closed

Description

I have a file playwright-cli.json in my working directory that's as follows:

{
  "network": {
    "allowedOrigins": [
      "lvh.me",
      "localhost",
      "0.0.0.0",
      "127.0.0.1",
      "pdf-service"
    ]
  }
}

The README suggests this will be automatically read if no extra args are specified:

The Playwright CLI can be configured using a JSON configuration file. You can specify the configuration file using the --config command line option:
playwright-cli --config path/to/config.json open example.com
Playwright CLI will load config from playwright-cli.json by default so that you did not need to specify it every time.

However, I'm not seeing the behaviour I expect (the request is blocked) unless I specify the filename to use:

simonfish@local freeagent % playwright-cli open https://simon.fish
### Browser `default` opened with pid 93381.
- default:
  - browser-type: chrome
  - user-data-dir: <in-memory>
  - headed: false
---
### Ran Playwright code
```js
await page.goto('https://simon.fish');
\```
### Page
- Page URL: https://simon.fish/
- Page Title: Engineering and educating for a free and open web - Simon Fish
### Snapshot
- [Snapshot](.playwright-cli/page-2026-02-18T16-56-40-883Z.yml)
simonfish@local freeagent % playwright-cli --config playwright-cli.json open https://simon.fish 
### Browser `default` opened with pid 93999.
- default:
  - browser-type: chrome
  - user-data-dir: <in-memory>
  - headed: false
---
### Error
Error: page.goto: net::ERR_BLOCKED_BY_CLIENT at https://simon.fish/
Call log:
  - navigating to "https://simon.fish/", waiting until "domcontentloaded"

simonfish@local freeagent % playwright-cli open https://simon.fish                             
### Browser `default` opened with pid 94167.
- default:
  - browser-type: chrome
  - user-data-dir: <in-memory>
  - headed: false
---
### Ran Playwright code
```js
await page.goto('https://simon.fish');
\```
### Page
- Page URL: https://simon.fish/
- Page Title: Engineering and educating for a free and open web - Simon Fish
### Snapshot
- [Snapshot](.playwright-cli/page-2026-02-18T16-58-18-155Z.yml)

Activity

  1. pavelfeldman commented on Feb 18, 2026

    @pavelfeldman
    Member

    There was a breaking change a while ago that moved it into .playwright/cli.json a while ago. Sorry about that.

  2. finalburn commented on Feb 19, 2026

    @finalburn
    ContributorAuthor

    I opened a PR to update it in the README, but moving the config file to that folder has the same results – that host is still reachable when it otherwise wouldn't be if the config is referenced directly as of 1.59.0-alpha-1771104257000:

    % playwright-cli open https://simon.fish --config .playwright/cli.json
    ### Browser `default` opened with pid 7892.
    - default:
      - browser-type: chrome
      - user-data-dir: <in-memory>
      - headed: false
    ---
    ### Error
    Error: page.goto: net::ERR_BLOCKED_BY_CLIENT at https://simon.fish/
    Call log:
      - navigating to "https://simon.fish/", waiting until "domcontentloaded"
    
  3. finalburn commented on Feb 19, 2026

    @finalburn
    ContributorAuthor

    Turns out (from reviewing the source) it's .playwright/cli.config.json. #272 updates the README to that effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions