Issue metadata
Sign in to add a comment
|
Emulation.setDeviceMetricsOverride doesn't ignore deviceScaleFactor = 0 |
||||||||||||||||||||||||
Issue descriptionThe Emulation.setDeviceMetricsOverride doesn't ignore a zero deviceScaleFactor like the documentation suggests.
,
Aug 15 2017
,
Aug 15 2017
What do you mean by "doesn't ignore"? It should retain existing dpr in this case. Do you have any specific examples?
,
Aug 16 2017
This was raised on the headless mailing list[1]. Basically the following script hangs but works if deviceScaleFactor is set to a non-zero value:
const CDP = require('chrome-remote-interface');
CDP((client) => {
const {Page, Emulation, Runtime} = client;
Page.loadEventFired(() => {
Page.captureScreenshot().then((result) => {
console.log(result);
client.close();
});
});
Promise.all([
Page.enable(),
Emulation.setDeviceMetricsOverride({
"width": 1024, "height": 768,"screenWidth": 1024,
"screenHeight": 768, "deviceScaleFactor": 0,
"mobile": false})
]).then(() => {
return Page.navigate({url: 'https://example.com'});
});
}).on('error', (err) => {
console.error('Cannot connect to remote endpoint:', err);
});
[1] https://groups.google.com/a/chromium.org/d/msgid/headless-dev/7414bfad-cbae-4cad-a575-41a5c8acfebe%40chromium.org?utm_medium=email&utm_source=footer
,
Aug 16 2017
Thank you for details! I think this is a bug where captureScreenshot hangs when deviceScaleFactor = 0. See issue 754708 . |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by skyos...@chromium.org
, Aug 15 2017