Originally posted in #37769
Starting with Chrome 141.0.7390.16 (Playwright 1.56.0-alpha-2025-09-12), we are experiencing CORS issues like the following:
Access to fetch at 'https://<internal-auth-system>/.well-known/openid-configuration' from
origin 'https://<dev-application>/' has been blocked by CORS policy: Permission was denied for
this request to access the `unknown` address space.
This is not a Playwright issue, rather, it is a new Chrome feature called Local Network Access prompts. In addition to our test execution failures on 1.56.0, some of our engineers also began seeing these issues in chromium-based browsers that enabled LNA by default.
The reason we are seeing these both in our dev environment and during Playwright test execution is because our internal-auth-system is behind a VPN and resolves to a 10.* IP address, which Chrome-with-LNA treats as non-public. A human user would get prompted to allow this network access, but the test execution treats it as a Deny and fetch() calls to retrieve the OAuth metadata fail.
According to the LNA Adoption Guide, automated test environments can preemptively set a local-network-access permission to allow local network access, but when I try to configure this in Playwright, it rejects the permission as invalid. I'm uncertain whether this rejection originates in Playwright or in Chromium, though.
Options to support LNA
- Playwright accepts
local-network-access permission
- Browser launch args include
--ip-address-space-overrides=10.1.2.3:0=public to treat specific endpoints as public — this is quite inconvenient because addresses must be specified individually (no wildcard support), which means pre-resolving all possible addresses in Playwright Config and dynamically generating the arguments for the current environment
- Modify all participating servers to include
Content-Security-Policy: treat-as-public-address as a blanket response header in non-public environments. We will likely pursue this path in order to solve for human and automated users.
I'll file separate issues in Chromium related to this, but in the event that the Playwright team can support Option 1 above (Playwright accepts local-network-access permission), that would be a great option to have.
Originally posted in #37769
Starting with Chrome 141.0.7390.16 (Playwright 1.56.0-alpha-2025-09-12), we are experiencing CORS issues like the following:
This is not a Playwright issue, rather, it is a new Chrome feature called Local Network Access prompts. In addition to our test execution failures on 1.56.0, some of our engineers also began seeing these issues in chromium-based browsers that enabled LNA by default.
The reason we are seeing these both in our dev environment and during Playwright test execution is because our
internal-auth-systemis behind a VPN and resolves to a10.*IP address, which Chrome-with-LNA treats as non-public. A human user would get prompted to allow this network access, but the test execution treats it as a Deny andfetch()calls to retrieve the OAuth metadata fail.According to the LNA Adoption Guide, automated test environments can preemptively set a
local-network-accesspermission to allow local network access, but when I try to configure this in Playwright, it rejects the permission as invalid. I'm uncertain whether this rejection originates in Playwright or in Chromium, though.Options to support LNA
local-network-accesspermission--ip-address-space-overrides=10.1.2.3:0=publicto treat specific endpoints as public — this is quite inconvenient because addresses must be specified individually (no wildcard support), which means pre-resolving all possible addresses in Playwright Config and dynamically generating the arguments for the current environmentContent-Security-Policy: treat-as-public-addressas a blanket response header in non-public environments. We will likely pursue this path in order to solve for human and automated users.I'll file separate issues in Chromium related to this, but in the event that the Playwright team can support Option 1 above (Playwright accepts
local-network-accesspermission), that would be a great option to have.