Skip to content

Commit bdf0821

Browse files
authored
Pattern updates (#309)
1 parent 8aab754 commit bdf0821

7 files changed

Lines changed: 37 additions & 28 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [5.1.43](https://github.com/omrilotan/isbot/compare/v5.1.42...v5.1.43)
4+
5+
- Pattern updates
6+
37
## [5.1.42](https://github.com/omrilotan/isbot/compare/v5.1.41...v5.1.42)
48

59
- Pattern updates

‎fixtures/browsers.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ Google Pixel:
269269
Google Search App:
270270
- Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) GSA/10.0.63022 Mobile/13B143 Safari/600.1.4
271271
- Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/102.0.304944559 Mobile/15E148 Safari/604.1
272+
Google Webview:
273+
- Mozilla/5.0 (iPhone; CPU iPhone OS 26_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 GoogleWv/1.0 (WKWebView) GeminiiOS/1.2026.2270600
272274
Hawk QuickBrowser:
273275
- Mozilla/5.0 (Linux; U; Android 7.0; es-us; Moto C Build/NRD90M.063) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/69.0.3497.100 Mobile Safari/537.36 Hawk/QuickBrowser/2.4.8.22800
274276
HiSearch:

‎fixtures/downloaded/myip.ms.json‎

Lines changed: 26 additions & 20 deletions
Large diffs are not rendered by default.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "isbot",
3-
"version": "5.1.42",
3+
"version": "5.1.43",
44
"description": "🤖/👨‍🦰 Recognise bots/crawlers/spiders using the user agent string.",
55
"keywords": [
66
"bot",

‎src/patterns.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
" daum[ /]",
33
" deusu/",
44
"(?:^|[^g])news(?!sapphire)",
5-
"(?<! (?:channel/|google/))google(?!(app|/google| pixel))",
5+
"(?<! (?:channel/|google/))google(?!(wv|app|/google| pixel))",
66
"(?<! cu)bots?(?:\\b|_)",
77
"(?<!(?:lib))http",
88
"(?<!cam)scan",

‎tests/spec/__snapshots__/test.ts.snap‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

3+
exports[`isbot features isbotPattern: find first pattern in bot user agent string 1`] = `"(?<! (?:channel/|google/))google(?!(wv|app|/google| pixel))"`;
4+
35
exports[`isbot module interface interface is as expected 1`] = `
46
[
57
[

‎tests/spec/test.ts‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,9 @@ describe("isbot", () => {
4949
expect(isbotMatches(BOT_USER_AGENT_EXAMPLE)).toHaveLength(4);
5050
});
5151
test("isbotPattern: find first pattern in bot user agent string", () => {
52-
expect(isbotPattern(BOT_USER_AGENT_EXAMPLE)).toBe(
53-
"(?<! (?:channel/|google/))google(?!(app|/google| pixel))",
54-
);
52+
expect(isbotPattern(BOT_USER_AGENT_EXAMPLE)).toMatchSnapshot();
5553
});
5654
test("isbotPatterns: find all patterns in bot user agent string", () => {
57-
expect(isbotPatterns(BOT_USER_AGENT_EXAMPLE)).toContain(
58-
"(?<! (?:channel/|google/))google(?!(app|/google| pixel))",
59-
);
6055
expect(isbotPatterns(BOT_USER_AGENT_EXAMPLE)).toHaveLength(4);
6156
});
6257
test("createIsbot: create custom isbot function with custom pattern", () => {

0 commit comments

Comments
 (0)