Skip to content
This repository has been archived by the owner on Mar 4, 2023. It is now read-only.

Latest commit

 

History

History
14 lines (13 loc) · 402 Bytes

Puppeteer device emulation.md

File metadata and controls

14 lines (13 loc) · 402 Bytes
const puppeteer = require('puppeteer');
const devices = require('puppeteer/DeviceDescriptors');
const iPhone = devices['iPhone 6'];

(async() => {
  const browser = await puppeteer.launch();
  let page = await browser.newPage();
  await page.emulate(iPhone);
  await page.goto('https://www.nytimes.com/');
  await page.screenshot({path: 'full.png', fullPage: true});
  browser.close();
})();