Skip to content

Weird viewport clipping #714

@brendt

Description

@brendt

On around 50% of occasions, I get very weird viewport clipping when screenshotting a page.

Here's what the image should look like:

Image

This is what it sometimes looks like:

Image

Other times it looks like this:

Image

I've tried manually setting the window size:

        $browser = new BrowserFactory()->createBrowser([
            'windowSize' => [1200, 628],
        ]);

As well as this:

            $page->setDeviceMetricsOverride([
                'width' => 1200,
                'height' => 628,
            ]);

Also tried with and without these options:

            $screenshot = $page->screenshot([
                'captureBeyondViewport' => true,
                'clip' => $page->getFullPageClip(),
            ]);

But still, the issue seems to persist from time to time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions