<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Page](./puppeteer.page.md) &gt; [emulateMediaType](./puppeteer.page.emulatemediatype.md)

## Page.emulateMediaType() method

<b>Signature:</b>

```typescript
emulateMediaType(type?: string): Promise<void>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  type | string | Changes the CSS media type of the page. The only allowed values are <code>screen</code>, <code>print</code> and <code>null</code>. Passing <code>null</code> disables CSS media emulation. |

<b>Returns:</b>

Promise&lt;void&gt;

## Example


```
await page.evaluate(() => matchMedia('screen').matches);
// → true
await page.evaluate(() => matchMedia('print').matches);
// → false

await page.emulateMediaType('print');
await page.evaluate(() => matchMedia('screen').matches);
// → false
await page.evaluate(() => matchMedia('print').matches);
// → true

await page.emulateMediaType(null);
await page.evaluate(() => matchMedia('screen').matches);
// → true
await page.evaluate(() => matchMedia('print').matches);
// → false

```

