const puppeteer = require('puppeteer'); 
const devices = require('puppeteer/DeviceDescriptors');
const iPhonex = devices['iPhone X']; puppeteer.launch().then(async nav => {   
	const page = await nav.newPage();
	//On utilise page.emulate donc inutile de définir le viewport
	await page.emulate(iPhonex);
	await page.goto('https://www.nytimes.com/');
	await page.screenshot({ path: 'nytimes-iphoneX.png'	});
	await nav.close(); 
});
Author