File tree Expand file tree Collapse file tree 1 file changed +32
-2
lines changed
Expand file tree Collapse file tree 1 file changed +32
-2
lines changed Original file line number Diff line number Diff line change 11import type { BotDetectionResult } from '@fingerprintjs/botd'
2- import type { BotDetectionContext } from '@nuxtjs/robots/util'
3- import { mapBotKindToCategory } from '@nuxtjs/robots/util'
2+ import type { BotDetectionContext } from '../../types'
43import { useStorage } from '@vueuse/core'
54import { ref } from 'vue'
65
6+ // TODO: import from @nuxtjs /robots/util once CI import issues resolved
7+ type BotCategory = 'search-engine' | 'social' | 'seo' | 'ai' | 'generic' | 'automation' | 'http-tool' | 'security-scanner' | 'scraping'
8+ type BotKind = 'awesomium' | 'cef' | 'cefsharp' | 'coachjs' | 'electron' | 'fminer' | 'geb' | 'nightmarejs' | 'phantomas' | 'phantomjs' | 'rhino' | 'selenium' | 'sequentum' | 'slimerjs' | 'webdriverio' | 'webdriver' | 'headless_chrome' | 'unknown'
9+ function mapBotKindToCategory ( botKind : BotKind ) : BotCategory {
10+ switch ( botKind ) {
11+ case 'selenium' :
12+ case 'webdriver' :
13+ case 'webdriverio' :
14+ case 'phantomjs' :
15+ case 'phantomas' :
16+ case 'nightmarejs' :
17+ case 'slimerjs' :
18+ case 'headless_chrome' :
19+ case 'electron' :
20+ case 'cef' :
21+ case 'cefsharp' :
22+ case 'rhino' :
23+ return 'automation'
24+ case 'fminer' :
25+ case 'sequentum' :
26+ case 'geb' :
27+ return 'scraping'
28+ case 'awesomium' :
29+ case 'coachjs' :
30+ return 'security-scanner'
31+ case 'unknown' :
32+ default :
33+ return 'generic'
34+ }
35+ }
36+
737// Persistent storage for client-side fingerprint detection results only
838const botDetectionStorage = import . meta. client
939 ? useStorage < BotDetectionContext | null > ( '__nuxt_robots:botd' , null , localStorage , {
You can’t perform that action at this time.
0 commit comments