Add --allowed-origins flag for Playwright browser navigation to localhost #6453
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Playwright browser in GitHub Actions could not navigate to localhost URLs despite localhost being in the allowed domains. The Playwright MCP server uses two separate flags:
--allowed-hostscontrols MCP server CORS, while--allowed-originscontrols browser navigation. We were only setting the former.Changes:
--allowed-originsflag to Playwright MCP configurations for all engines (Claude, Copilot, Codex)localhost,localhost:*,127.0.0.1,127.0.0.1:*pkg/workflow/mcp-config.goandpkg/workflow/mcp_renderer.goExample output:
This enables documentation testing, local server testing, and other workflows that require Playwright to access localhost in GitHub Actions.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/user/usr/bin/gh gh api user --jq .login 08431cddfb8368fd83d5badbf9bfd GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env tags/v6 GO111MODULE ps GOINSECURE GOMOD GOMODCACHE ps(http block)/usr/bin/gh gh api user --jq .login -json 98934cb7db3cf861b1c3912a44c25fe853f52e101adce49a243 ache/go/1.25.0/x64/pkg/tool/linux_amd64/cgo 98934cb7db3cf861git(http block)/usr/bin/gh gh api user --jq .login /run/containerd/io.containerd.runtime.v2.task/moby/412f2133922a5790ab7dae82709d4a5952fe5abddb2578c8a19a9a4c54e16330/init.pid 412f2133922a5790ab7dae82709d4a5952fe5abddb2578c8a19a9a4c54e16330 605619/b123=> a5952fe5abddb2578c8a19a9a4c54e16330/log.json bnext/gh-aw/cmd/aw -d/gh-aw go env s -d/gh-aw /opt/hostedtoolcache/go/1.25.0/xjson GOINSECURE GOMOD GOMODCACHE 605619/b123/impo/var/run/docker/runtime-runc/moby(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.