Skip to content

[Bug]: Chromium browser context sends empty user agent unless explicitly set #46

@garysassano

Description

@garysassano

Version

0.0.10

Steps to reproduce

Deploy the following worker

import { launch } from '@cloudflare/playwright';

export default {
  async fetch(request: Request, env: Env) {
    const browser = await launch(env.MYBROWSER);
    const page = await browser.newPage();

    await page.goto('https://www.google.com/shopping/product/2952639642818279633/offers');

    const img = await page.screenshot();
    await browser.close();

    return new Response(img, {
      headers: {
        'Content-Type': 'image/png',
      },
    });
  },
}

Expected behavior

I expected Playwright to return this screenshot of the page:

Image

Actual behavior

Playwright isn't able to render JavaScript and returns a blank page:

Image

Additional context

No response

Environment

Ubuntu 24.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions