1.0.0 • Published 6 years ago
puppeteer-detector v1.0.0
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)
}
1.0.0
6 years ago