What is wrong
Google Chrome 104.0.5112.79
has such policies (see browser_protocol.pdl#L6178-L6184):
- Allow
- BlockFromInsecureToMorePrivate
- WarnFromInsecureToMorePrivate
- PreflightBlock
- PreflightWarn
And github.com/chromedp/cdproto v0.0.0-20220816211547-b8b15824df23
supports the same list of polices (see cdproto).
So the error looks impossible.
What to do next
The last change to PrivateNetworkRequestPolicy
is 97.0.4665.1_9.7.3 which adds two new values:
- PreflightBlock
- PreflightWarn
Please double check the version of the chromedp/cdproto
package and the version of the browser.
Now that Chrome 105
has been released, please upgrade to this version. Maybe it will address the issue.
It will be helpful if you can enable the debug log to record what is the invalid value. Enable the debug log like this:
ctx, cancel := chromedp.NewContext(ctx, chromedp.WithDebugf(log.Printf))