1
0
mirror of https://github.com/lancedikson/bowser synced 2026-03-02 03:40:27 +00:00

feat: Add Slack bot detection (#596)

Co-authored-by: Jam <jam.hsu@lativ.com.tw>
This commit is contained in:
Jam Hsu
2026-02-01 00:54:09 +08:00
committed by GitHub
parent 0f51d8bce8
commit 74463f6b23
4 changed files with 64 additions and 0 deletions

View File

@@ -52,6 +52,7 @@ export const BROWSER_ALIASES_MAP = {
Safari: 'safari',
Sailfish: 'sailfish',
'Samsung Internet for Android': 'samsung_internet',
SlackBot: 'slackbot',
SeaMonkey: 'seamonkey',
Sleipnir: 'sleipnir',
'Sogou Browser': 'sogou',
@@ -120,6 +121,7 @@ export const BROWSER_MAP = {
sailfish: 'Sailfish',
samsung_internet: 'Samsung Internet for Android',
seamonkey: 'SeaMonkey',
slackbot: 'SlackBot',
sleipnir: 'Sleipnir',
sogou: 'Sogou Browser',
swing: 'Swing',

View File

@@ -361,6 +361,23 @@ const browsersList = [
},
},
/* SlackBot */
{
test: [/slackbot/i, /slack-imgProxy/i],
describe(ua) {
const browser = {
name: 'SlackBot',
};
const version = Utils.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
if (version) {
browser.version = version;
}
return browser;
},
},
/* YahooSlurp */
{
test: [/yahoo!?[\s/]*slurp/i],

View File

@@ -227,6 +227,17 @@ export default [
},
},
/* SlackBot */
{
test: [/slackbot/i, /slack-imgProxy/i],
describe() {
return {
type: PLATFORMS_MAP.bot,
vendor: 'Slack',
};
},
},
/* Yahoo! Slurp */
{
test: [/yahoo/i],