Skip to content

Commit

Permalink
fix detectPluginsLengthInconsistency (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
xnerhu authored Sep 9, 2023
1 parent 4f5c28d commit 28727f2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/detectors/plugins_inconsistency.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { BotKind, BrowserKind, ComponentDict, DetectorResponse, State } from '../types'
import { getBrowserKind, isAndroid } from '../utils/browser'
import { BotKind, BrowserEngineKind, BrowserKind, ComponentDict, DetectorResponse, State } from '../types'
import { getBrowserEngineKind, getBrowserKind, isAndroid } from '../utils/browser'

export function detectPluginsLengthInconsistency({ pluginsLength }: ComponentDict): DetectorResponse {
if (pluginsLength.state !== State.Success) return
const browserKind = getBrowserKind()
if (browserKind !== BrowserKind.Chrome || isAndroid()) return
const browserEngineKind = getBrowserEngineKind()
if (browserKind !== BrowserKind.Chrome || isAndroid() || browserEngineKind !== BrowserEngineKind.Chromium) return
if (pluginsLength.value === 0) return BotKind.HeadlessChrome
}

0 comments on commit 28727f2

Please sign in to comment.