docs(api.md): emulateMedia example fix (#2100)
This commit is contained in:
Родитель
932d6ba6df
Коммит
ef9eed8702
|
@ -1085,7 +1085,7 @@ await page.dispatchEvent('#source', 'dragstart', { dataTransfer });
|
||||||
await page.evaluate(() => matchMedia('screen').matches));
|
await page.evaluate(() => matchMedia('screen').matches));
|
||||||
// → true
|
// → true
|
||||||
await page.evaluate(() => matchMedia('print').matches));
|
await page.evaluate(() => matchMedia('print').matches));
|
||||||
// → true
|
// → false
|
||||||
|
|
||||||
await page.emulateMedia({ media: 'print' });
|
await page.emulateMedia({ media: 'print' });
|
||||||
await page.evaluate(() => matchMedia('screen').matches));
|
await page.evaluate(() => matchMedia('screen').matches));
|
||||||
|
@ -1097,7 +1097,7 @@ await page.emulateMedia({});
|
||||||
await page.evaluate(() => matchMedia('screen').matches));
|
await page.evaluate(() => matchMedia('screen').matches));
|
||||||
// → true
|
// → true
|
||||||
await page.evaluate(() => matchMedia('print').matches));
|
await page.evaluate(() => matchMedia('print').matches));
|
||||||
// → true
|
// → false
|
||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|
Загрузка…
Ссылка в новой задаче