Skip to content

Commit

Permalink
docs(page): add missing docs on emulateMedia (#6322)
Browse files Browse the repository at this point in the history
  • Loading branch information
kblok committed Apr 30, 2021
1 parent 6c04b82 commit dec9736
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/src/api/class-page.md
Expand Up @@ -732,6 +732,8 @@ Optional event-specific initialization properties.

## async method: Page.emulateMedia

This method changes the `CSS media type` through the `media` argument, and/or the `'prefers-colors-scheme'` media feature, using the `colorScheme` argument.

```js
await page.evaluate(() => matchMedia('screen').matches);
// → true
Expand Down
3 changes: 3 additions & 0 deletions types/types.d.ts
Expand Up @@ -1632,6 +1632,9 @@ export interface Page {
}): Promise<void>;

/**
* This method changes the `CSS media type` through the `media` argument, and/or the `'prefers-colors-scheme'` media
* feature, using the `colorScheme` argument.
*
* ```js
* await page.evaluate(() => matchMedia('screen').matches);
* // → true
Expand Down

0 comments on commit dec9736

Please sign in to comment.