UNPKG

puppeteer-core

Version:

A high-level API to control headless Chrome over the DevTools Protocol

28 lines • 881 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EmulationManager = void 0; /** * @internal */ class EmulationManager { #browsingContext; constructor(browsingContext) { this.#browsingContext = browsingContext; } async emulateViewport(viewport) { await this.#browsingContext.connection.send('browsingContext.setViewport', { context: this.#browsingContext.id, viewport: viewport.width && viewport.height ? { width: viewport.width, height: viewport.height, } : null, devicePixelRatio: viewport.deviceScaleFactor ? viewport.deviceScaleFactor : null, }); } } exports.EmulationManager = EmulationManager; //# sourceMappingURL=EmulationManager.js.map