Skip to content

Fix Invalid referrerPolicy error in latest versions of Chromium #2924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Manny651
Copy link

Calling GoToAsync without specifying a ReferrerPolicy option now raises an exception when used with the latest Chromium builds for Linux:

PuppeteerSharp.MessageException: Protocol error (Page.navigate): Invalid referrerPolicy
at Helpers.TaskHelper.WithTimeout[T](Task1 task, TimeSpan timeout, Func2 exceptionFactory) in Helpers/TaskHelper.cs:line 188
at Cdp.CdpCDPSession.SendAsync(String method, Object args, Boolean waitForCallback, CommandOptions options) in Cdp/CdpCDPSession.cs:line 113
at PuppeteerSharp.CDPSession.SendAsync[T](String method, Object args, CommandOptions options) in PuppeteerSharp/CDPSession.cs:line 48
at PuppeteerSharp.Cdp.CdpFrame.<>c__DisplayClass15_0.<g__NavigateAsync|0>d.MoveNext() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Cdp/CdpFrame.cs:line 113
at Cdp.CdpFrame.GoToAsync(String url, NavigationOptions options) in Cdp/CdpFrame.cs:line 95
at Cdp.CdpFrame.GoToAsync(String url, NavigationOptions options) in Cdp/CdpFrame.cs:line 106

After researching the Chromium codebase, my understanding is that CDP does not accept empty strings for the ReferrerPolicy parameter. This specific validation message seems to originate from chromium/chromium@57103b9

@kblok
Copy link
Member

kblok commented Jun 18, 2025

Thank you!

@kblok
Copy link
Member

kblok commented Jun 18, 2025

@Manny651 Don't you think we should implement this https://github.com/puppeteer/puppeteer/pull/13954/files ?

@Manny651
Copy link
Author

@kblok Yes, I added that same logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants