1.0.0 • Published 6 years ago

puppeteer-detector v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

Puppeteer Detector

Important!: This lib only for Puppeteer(Chrome).

Usage

    const detector = require('puppeteer-detector')
    
    detector.check()

Functions

check: if puppeteer returns true, otherwise false

Overwrite controls

if you want to overwrite;

    detector.controls = {
      userAgent: require('./src/libs/userAgent'),
      chromeObject: require('./src/libs/chromeObject'),
      webDriver: require('./src/libs/webDriver'),
    }

Libs

User Agent

module.exports = ()  => {
  return !/HeadlessChrome/.test(navigator.userAgent)
}

Chrome Object

module.exports = ()  => {
  return window.chrome && window.chrome.runtime
}

Web Driver

module.exports = ()  => {
  return !!(navigator.webdriver)
}