docs(page): add missing docs on emulateMedia (#6322)

This commit is contained in:
Darío Kondratiuk 2021-04-30 01:08:30 -03:00 committed by GitHub
parent 6c04b82256
commit dec973611c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -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

3
types/types.d.ts vendored
View File

@ -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