Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 974 Bytes

File metadata and controls

47 lines (33 loc) · 974 Bytes

polyfill.headless

Note

This plugin only applies to Chromium.

Tip

This plugin is enabled in the ⭐️ recommended.

Correct many differences in JavaScript APIs between the headful and headless versions of Chromium. This plugin activates Chromium's new headless mode.

Options

This plugin has no option.

Example

Use the plugin.

import { chromium } from "playwright-ghost";
import plugins from "playwright-ghost/plugins";

const browser = await chromium.launch({
  plugins: [plugins.polyfill.headless()],
});
// ...

Advanced

Import

If you want to import only this plugin, you can use the "playwright-ghost/plugins/polyfill/headless" path in the import.

import { chromium } from "playwright-ghost";
import polyfillHeadlessPlugin from "playwright-ghost/plugins/polyfill/headless";

const browser = await chromium.launch({
  plugins: [polyfillHeadlessPlugin()],
});
// ...