Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fresh/tests/deps.ts>Page#emulate

The next-gen web framework.
Extremely Popular
Go to Latest
method Page.prototype.emulate
Re-export
import { Page } from "https://deno.land/x/fresh@1.2.0/tests/deps.ts";

Emulates given device metrics and user agent.

Examples

Example 1

const puppeteer = require('puppeteer');
const iPhone = puppeteer.devices['iPhone 6'];
(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.emulate(iPhone);
  await page.goto('https://www.google.com');
  // other actions...
  await browser.close();
})();

Parameters

options: { viewport: Viewport; userAgent: string; }

Returns

Promise<void>