Skip to content

[BUG] webkit browser doesn't work well with deviceScaleFactor on ubuntu docker #1631

Closed

Description

Context:

Code Snippet

When you running this script in the ubuntu docker

const { webkit } = require('playwright');

(async () => {
   const WEBKIT_DEVICE = Playwright.devices['iPhone 6']
  const browser = await webkit.launch({ dumpio: true });
  const context = await browser.newContext(WEBKIT_DEVICE);
  const page = await context.newPage();
  await page.goto('https://google.com');
  await page.screenshot({path: 'screenshot.png'});
  await browser.close();
})();

Describe the bug
Getting snapshot image like this:

screenshot

note that the screenshot has correct dimension (750 x 1334), however, the site was loaded under the unscaled dimension (375 x 667). So the deviceScaleFactor (which is 2 for iPhone 6) doesn't really work.

Also I am seeing some error from the browser:

[err] EGLDisplay Initialization failed: EGL_NOT_INITIALIZED
[err]
[err] ** (WPEWebProcess:559): WARNING **: 23:53:54.649: Error loading the injected bundle (/usr/local/lib/wpe-webkit-1.0/injected-bundle/libWPEInjectedBundle.so): /usr/local/lib/wpe-webkit-1.0/injected-bundle/libWPEInjectedBundle.so: cannot open shared object file: No such file or directory
[err] Fontconfig error: Cannot load default config file
[err] GLib-GIO-Message: 23:53:54.725: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

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