UNPKG

puppeteer-extra-plugin-stealth

Version:

Stealth mode: Applies various techniques to make detection of headless puppeteer harder.

21 lines (15 loc) 520 B
'use strict' const PuppeteerExtraPlugin = require('puppeteer-extra-plugin') /** * Pass toString test, though it breaks console.debug() from working */ class Plugin extends PuppeteerExtraPlugin { constructor (opts = { }) { super(opts) } get name () { return 'stealth/evasions/console.debug' } async onPageCreated (page) { await page.evaluateOnNewDocument(() => { window.console.debug = () => { return null } }) } } module.exports = function (pluginConfig) { return new Plugin(pluginConfig) }