Skip to content

Conversation

@kuba-orlik
Copy link
Collaborator

What kind of change does this PR introduce?

Avoids a situation where user-agend is empty

Did you add tests for your changes?

✔️

If relevant, did you update the documentation?

Not relevant - no API changes

Summary

The cloud browser does not set a default user agent

Does this PR introduce a breaking change?

Not to my knowledge

@github-actions github-actions bot added the Stale label Aug 1, 2025
@github-actions github-actions bot removed the Stale label Aug 7, 2025
return await this.#defaultContext.newPage();
const page = await this.#defaultContext.newPage();
await page.setUserAgent(
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also need to do the same thing in BrowserContext. I think that both Browser.newPage and BrowserContext.newPage end up calling https://github.com/cloudflare/puppeteer/blob/19e40c556e10b8d259df11f0dc32ea4f1a495789/packages/puppeteer-core/src/cdp/Browser.ts#L346C1-L347C1.

@github-actions github-actions bot added the Stale label Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants