Skip to content

Commit 4c64e4e

Browse files
committed
Revert "fix: runtime resolution bug on @nuxtjs/robots/util"
This reverts commit 6c9ade8.
1 parent bea87f6 commit 4c64e4e

File tree

1 file changed

+2
-32
lines changed

1 file changed

+2
-32
lines changed

src/runtime/app/utils/fingerprinting.ts

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,9 @@
11
import type { BotDetectionResult } from '@fingerprintjs/botd'
2-
import type { BotDetectionContext } from '../../types'
2+
import type { BotDetectionContext } from '@nuxtjs/robots/util'
3+
import { mapBotKindToCategory } from '@nuxtjs/robots/util'
34
import { useStorage } from '@vueuse/core'
45
import { ref } from 'vue'
56

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-
377
// Persistent storage for client-side fingerprint detection results only
388
const botDetectionStorage = import.meta.client
399
? useStorage<BotDetectionContext | null>('__nuxt_robots:botd', null, localStorage, {

0 commit comments

Comments
 (0)