Emulating mobile devices
The first type of emulation I want to cover is mobile emulation. In this section, we will cover the three elements that Puppeteer can emulate: The viewport, the touchscreen, and the user agent. We have to keep in mind that it is a browser trying to emulate a mobile device. Puppeteer and Chromium won't be able to emulate any hardware limitations or any other specific features that certain mobile phones offer. There is no real device behind the curtains; it's just a browser trying to show you how a website would look on that device's screen.
As I mentioned previously, 55% of the internet traffic comes from mobile devices. Most of the diversity we saw in the previous section is in the mobile world.
Let's take a look at some of the browser distribution in the mobile world:
The mobile market is mostly divided between Chrome and Safari. One thing you...