mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: supress viewport errors for pages that do not support changing it (#11970)
This commit is contained in:
parent
5bbee1068f
commit
753a954456
@ -267,13 +267,23 @@ export class EmulationManager {
|
||||
const hasTouch = viewport.hasTouch || false;
|
||||
|
||||
await Promise.all([
|
||||
client.send('Emulation.setDeviceMetricsOverride', {
|
||||
mobile,
|
||||
width,
|
||||
height,
|
||||
deviceScaleFactor,
|
||||
screenOrientation,
|
||||
}),
|
||||
client
|
||||
.send('Emulation.setDeviceMetricsOverride', {
|
||||
mobile,
|
||||
width,
|
||||
height,
|
||||
deviceScaleFactor,
|
||||
screenOrientation,
|
||||
})
|
||||
.catch(err => {
|
||||
if (
|
||||
err.message.includes('Target does not support metrics override')
|
||||
) {
|
||||
debugError(err);
|
||||
return;
|
||||
}
|
||||
throw err;
|
||||
}),
|
||||
client.send('Emulation.setTouchEmulationEnabled', {
|
||||
enabled: hasTouch,
|
||||
}),
|
||||
|
Loading…
Reference in New Issue
Block a user