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

x/pptr/src/Input.ts>Keyboard#type

Headless Chrome Deno API
Latest
method Keyboard.prototype.type
import { Keyboard } from "https://deno.land/x/pptr@1.2.0/src/Input.ts";

Sends a keydown, keypress/input, and keyup event for each character in the text.

Examples

Example 1

await page.keyboard.type('Hello'); // Types instantly
await page.keyboard.type('World', {delay: 100}); // Types slower, like a user

Parameters

text: string
  • A text to type into a focused element.
optional
options: { delay?: number; } = [UNSUPPORTED]
  • An object of options. Accepts delay which, if specified, is the time to wait between keydown and keyup in milliseconds. Defaults to 0.

Returns

Promise<void>