Display console messages and error from the browser in the program console.
This plugin is not recommended for use in production.
This plugin supports the following option:
console(defaulttrue): Flag to transfer console messages.pageError(defaulttrue): Flag to transfer error.
Use the plugin with default options (all transfer).
import { chromium } from "playwright-ghost";
import plugins from "playwright-ghost/plugins";
const browser = await chromium.launch({
plugins: [plugins.debug.console()],
});
// ...Use the plugin and transfer only error.
import { chromium } from "playwright-ghost";
import plugins from "playwright-ghost/plugins";
const browser = await chromium.launch({
plugins: [plugins.debug.console({ console: false })],
});
// ...If you want to import only this plugin, you can use the
"playwright-ghost/plugins/debug/console" path in the import.
import { chromium } from "playwright-ghost";
import debugConsolePlugin from "playwright-ghost/plugins/debug/console";
const browser = await chromium.launch({
plugins: [debugConsolePlugin()],
});
// ...