Monitor all JavaScript properties used in a page. This plugin adds the sniffer
property to the Page class, with
two methods:
get(): get the list of properties;reset(): reset the list.
This plugin is not recommended for use in production.
This plugin has no option.
Use the plugin.
import { chromium } from "playwright-ghost";
import plugins from "playwright-ghost/plugins";
const browser = await chromium.launch({
plugins: [plugins.debug.sniffer()],
});
const context = await browser.newContext();
const page = await context.newPage();
await page.goto("https://www.wikipedia.org/");
console.log(page.sniffer.get());
// ...If you want to import only this plugin, you can use the
"playwright-ghost/plugins/debug/sniffer" path in the import.
import { chromium } from "playwright-ghost";
import debugSnifferPlugin from "playwright-ghost/plugins/debug/sniffer";
const browser = await chromium.launch({
plugins: [debugSnifferPlugin()],
});
// ...