@aws/lsp-codewhisperer 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/node_modules/@amzn/codewhisperer-streaming/package.json +4 -4
- package/node_modules/@aws/lsp-fqn/out/common/commonFqnWorkerPool.js +12 -25
- package/node_modules/@aws/lsp-fqn/out/common/commonFqnWorkerPool.js.map +1 -1
- package/node_modules/@aws/lsp-fqn/out/common/fqnExtractor.js +1 -2
- package/node_modules/@aws/lsp-fqn/out/common/fqnExtractor.js.map +1 -1
- package/node_modules/@aws/lsp-fqn/package.json +1 -1
- package/node_modules/@aws/lsp-fqn/tsconfig.tsbuildinfo +1 -1
- package/out/client/streamingClient/codewhispererStreamingClient.d.ts +5 -0
- package/out/client/streamingClient/codewhispererStreamingClient.js +25 -0
- package/out/client/streamingClient/codewhispererStreamingClient.js.map +1 -0
- package/out/client/token/bearer-token-service.json +55 -2
- package/out/index.d.ts +1 -0
- package/out/index.js +1 -0
- package/out/index.js.map +1 -1
- package/out/language-server/chat/chatController.js +104 -108
- package/out/language-server/chat/chatController.js.map +1 -1
- package/out/language-server/chat/chatController.test.js +16 -1
- package/out/language-server/chat/chatController.test.js.map +1 -1
- package/out/language-server/chat/chatEventParser.js +28 -34
- package/out/language-server/chat/chatEventParser.js.map +1 -1
- package/out/language-server/chat/chatSessionManagementService.js +22 -36
- package/out/language-server/chat/chatSessionManagementService.js.map +1 -1
- package/out/language-server/chat/chatSessionService.js +24 -37
- package/out/language-server/chat/chatSessionService.js.map +1 -1
- package/out/language-server/chat/constants.d.ts +2 -0
- package/out/language-server/chat/constants.js +32 -0
- package/out/language-server/chat/constants.js.map +1 -0
- package/out/language-server/chat/contexts/documentContext.js +11 -24
- package/out/language-server/chat/contexts/documentContext.js.map +1 -1
- package/out/language-server/chat/contexts/documentFqnExtractor.js +67 -78
- package/out/language-server/chat/contexts/documentFqnExtractor.js.map +1 -1
- package/out/language-server/chat/contexts/triggerContext.js +32 -44
- package/out/language-server/chat/contexts/triggerContext.js.map +1 -1
- package/out/language-server/chat/quickActions.d.ts +0 -1
- package/out/language-server/chat/quickActions.js +1 -28
- package/out/language-server/chat/quickActions.js.map +1 -1
- package/out/language-server/chat/telemetry/chatTelemetryController.js +114 -126
- package/out/language-server/chat/telemetry/chatTelemetryController.js.map +1 -1
- package/out/language-server/chat/utils.d.ts +6 -0
- package/out/language-server/chat/utils.js +60 -0
- package/out/language-server/chat/utils.js.map +1 -0
- package/out/language-server/codeWhispererService.js +13 -11
- package/out/language-server/codeWhispererService.js.map +1 -1
- package/out/language-server/constants.d.ts +3 -0
- package/out/language-server/constants.js +7 -0
- package/out/language-server/constants.js.map +1 -0
- package/out/language-server/dependencyGraph/csharpDependencyGraph.js +2 -2
- package/out/language-server/dependencyGraph/csharpDependencyGraph.js.map +1 -1
- package/out/language-server/dependencyGraph/dependencyGraph.js +12 -9
- package/out/language-server/dependencyGraph/dependencyGraph.js.map +1 -1
- package/out/language-server/dependencyGraph/gitIgnoreFilter.js +1 -0
- package/out/language-server/dependencyGraph/gitIgnoreFilter.js.map +1 -1
- package/out/language-server/netTransform/artifactManager.d.ts +29 -0
- package/out/language-server/netTransform/artifactManager.js +191 -0
- package/out/language-server/netTransform/artifactManager.js.map +1 -0
- package/out/language-server/netTransform/converter.d.ts +7 -0
- package/out/language-server/netTransform/converter.js +88 -0
- package/out/language-server/netTransform/converter.js.map +1 -0
- package/out/language-server/netTransform/metrics.d.ts +17 -0
- package/out/language-server/netTransform/metrics.js +222 -0
- package/out/language-server/netTransform/metrics.js.map +1 -0
- package/out/language-server/netTransform/models.d.ts +84 -0
- package/out/language-server/netTransform/models.js +12 -0
- package/out/language-server/netTransform/models.js.map +1 -0
- package/out/language-server/netTransform/resources/SupportedProjects.d.ts +2 -0
- package/out/language-server/netTransform/resources/SupportedProjects.js +26 -0
- package/out/language-server/netTransform/resources/SupportedProjects.js.map +1 -0
- package/out/language-server/netTransform/tests/converter.test.d.ts +1 -0
- package/out/language-server/netTransform/tests/converter.test.js +151 -0
- package/out/language-server/netTransform/tests/converter.test.js.map +1 -0
- package/out/language-server/netTransform/tests/mockData.d.ts +21 -0
- package/out/language-server/netTransform/tests/mockData.js +60 -0
- package/out/language-server/netTransform/tests/mockData.js.map +1 -0
- package/out/language-server/netTransform/tests/transformHandler.test.d.ts +1 -0
- package/out/language-server/netTransform/tests/transformHandler.test.js +242 -0
- package/out/language-server/netTransform/tests/transformHandler.test.js.map +1 -0
- package/out/language-server/netTransform/tests/validation.test.d.ts +1 -0
- package/out/language-server/netTransform/tests/validation.test.js +80 -0
- package/out/language-server/netTransform/tests/validation.test.js.map +1 -0
- package/out/language-server/netTransform/transformHandler.d.ts +27 -0
- package/out/language-server/netTransform/transformHandler.js +315 -0
- package/out/language-server/netTransform/transformHandler.js.map +1 -0
- package/out/language-server/netTransform/validation.d.ts +9 -0
- package/out/language-server/netTransform/validation.js +79 -0
- package/out/language-server/netTransform/validation.js.map +1 -0
- package/out/language-server/netTransformServer.d.ts +5 -6
- package/out/language-server/netTransformServer.js +149 -15
- package/out/language-server/netTransformServer.js.map +1 -1
- package/out/language-server/proxy-server.d.ts +1 -0
- package/out/language-server/proxy-server.js +16 -1
- package/out/language-server/proxy-server.js.map +1 -1
- package/out/language-server/securityScan/securityScanDiagnosticsProvider.js +10 -6
- package/out/language-server/securityScan/securityScanDiagnosticsProvider.js.map +1 -1
- package/out/language-server/securityScan/securityScanHandler.js +4 -0
- package/out/language-server/securityScan/securityScanHandler.js.map +1 -1
- package/out/language-server/session/sessionManager.js +35 -15
- package/out/language-server/session/sessionManager.js.map +1 -1
- package/out/language-server/telemetry/codeDiffTracker.js +69 -80
- package/out/language-server/telemetry/codeDiffTracker.js.map +1 -1
- package/out/language-server/telemetry/codePercentage.js +3 -0
- package/out/language-server/telemetry/codePercentage.js.map +1 -1
- package/out/language-server/telemetry/metric.js +8 -21
- package/out/language-server/telemetry/metric.js.map +1 -1
- package/out/language-server/telemetry/types.d.ts +38 -0
- package/out/language-server/telemetry/types.js.map +1 -1
- package/out/language-server/utils.d.ts +2 -5
- package/out/language-server/utils.js +25 -49
- package/out/language-server/utils.js.map +1 -1
- package/package.json +5 -2
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/HISTORY.md +0 -395
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/LICENSE +0 -201
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/README.md +0 -530
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/worker.js +0 -288
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/worker.js.map +0 -1
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/worker.min.js +0 -2
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/worker.min.js.map +0 -1
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/workerpool.js +0 -1737
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/workerpool.js.map +0 -1
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/workerpool.min.js +0 -3
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/workerpool.min.js.LICENSE.txt +0 -24
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/dist/workerpool.min.js.map +0 -1
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/package.json +0 -57
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/Pool.js +0 -476
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/Promise.js +0 -293
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/WorkerHandler.js +0 -547
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/debug-port-allocator.js +0 -28
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/environment.js +0 -30
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/generated/embeddedWorker.js +0 -6
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/header.js +0 -24
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/index.js +0 -60
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/requireFoolWebpack.js +0 -8
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/transfer.js +0 -12
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/types.js +0 -46
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/validateOptions.js +0 -51
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/src/worker.js +0 -256
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/Pool.d.ts +0 -130
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/Promise.d.ts +0 -125
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/WorkerHandler.d.ts +0 -89
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/debug-port-allocator.d.ts +0 -8
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/environment.d.ts +0 -4
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/generated/embeddedWorker.d.ts +0 -2
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/index.d.ts +0 -43
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/transfer.d.ts +0 -19
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/types.d.ts +0 -99
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/validateOptions.d.ts +0 -4
- package/node_modules/@aws/lsp-fqn/node_modules/workerpool/types/worker.d.ts +0 -8
- package/node_modules/@smithy/eventstream-serde-config-resolver/LICENSE +0 -201
- package/node_modules/@smithy/eventstream-serde-config-resolver/README.md +0 -10
- package/node_modules/@smithy/eventstream-serde-config-resolver/dist-cjs/EventStreamSerdeConfig.js +0 -1
- package/node_modules/@smithy/eventstream-serde-config-resolver/dist-cjs/index.js +0 -37
- package/node_modules/@smithy/eventstream-serde-config-resolver/dist-es/EventStreamSerdeConfig.js +0 -4
- package/node_modules/@smithy/eventstream-serde-config-resolver/dist-es/index.js +0 -1
- package/node_modules/@smithy/eventstream-serde-config-resolver/dist-types/EventStreamSerdeConfig.d.ts +0 -24
- package/node_modules/@smithy/eventstream-serde-config-resolver/dist-types/index.d.ts +0 -4
- package/node_modules/@smithy/eventstream-serde-config-resolver/dist-types/ts3.4/EventStreamSerdeConfig.d.ts +0 -24
- package/node_modules/@smithy/eventstream-serde-config-resolver/dist-types/ts3.4/index.d.ts +0 -4
- package/node_modules/@smithy/eventstream-serde-config-resolver/package.json +0 -61
- package/node_modules/bowser/CHANGELOG.md +0 -218
- package/node_modules/bowser/LICENSE +0 -39
- package/node_modules/bowser/README.md +0 -179
- package/node_modules/bowser/bundled.js +0 -1
- package/node_modules/bowser/es5.js +0 -1
- package/node_modules/bowser/index.d.ts +0 -250
- package/node_modules/bowser/package.json +0 -83
- package/node_modules/bowser/src/bowser.js +0 -77
- package/node_modules/bowser/src/constants.js +0 -116
- package/node_modules/bowser/src/parser-browsers.js +0 -700
- package/node_modules/bowser/src/parser-engines.js +0 -120
- package/node_modules/bowser/src/parser-os.js +0 -199
- package/node_modules/bowser/src/parser-platforms.js +0 -266
- package/node_modules/bowser/src/parser.js +0 -496
- package/node_modules/bowser/src/utils.js +0 -309
- package/node_modules/tslib/CopyrightNotice.txt +0 -15
- package/node_modules/tslib/LICENSE.txt +0 -12
- package/node_modules/tslib/README.md +0 -164
- package/node_modules/tslib/SECURITY.md +0 -41
- package/node_modules/tslib/modules/index.d.ts +0 -37
- package/node_modules/tslib/modules/index.js +0 -68
- package/node_modules/tslib/modules/package.json +0 -3
- package/node_modules/tslib/package.json +0 -47
- package/node_modules/tslib/tslib.d.ts +0 -453
- package/node_modules/tslib/tslib.es6.html +0 -1
- package/node_modules/tslib/tslib.es6.js +0 -374
- package/node_modules/tslib/tslib.es6.mjs +0 -373
- package/node_modules/tslib/tslib.html +0 -1
- package/node_modules/tslib/tslib.js +0 -424
- package/node_modules/uuid/CHANGELOG.md +0 -274
- package/node_modules/uuid/CONTRIBUTING.md +0 -18
- package/node_modules/uuid/LICENSE.md +0 -9
- package/node_modules/uuid/README.md +0 -466
- package/node_modules/uuid/dist/bin/uuid +0 -2
- package/node_modules/uuid/dist/commonjs-browser/index.js +0 -79
- package/node_modules/uuid/dist/commonjs-browser/md5.js +0 -223
- package/node_modules/uuid/dist/commonjs-browser/native.js +0 -11
- package/node_modules/uuid/dist/commonjs-browser/nil.js +0 -8
- package/node_modules/uuid/dist/commonjs-browser/parse.js +0 -45
- package/node_modules/uuid/dist/commonjs-browser/regex.js +0 -8
- package/node_modules/uuid/dist/commonjs-browser/rng.js +0 -25
- package/node_modules/uuid/dist/commonjs-browser/sha1.js +0 -104
- package/node_modules/uuid/dist/commonjs-browser/stringify.js +0 -44
- package/node_modules/uuid/dist/commonjs-browser/v1.js +0 -107
- package/node_modules/uuid/dist/commonjs-browser/v3.js +0 -16
- package/node_modules/uuid/dist/commonjs-browser/v35.js +0 -80
- package/node_modules/uuid/dist/commonjs-browser/v4.js +0 -43
- package/node_modules/uuid/dist/commonjs-browser/v5.js +0 -16
- package/node_modules/uuid/dist/commonjs-browser/validate.js +0 -17
- package/node_modules/uuid/dist/commonjs-browser/version.js +0 -21
- package/node_modules/uuid/dist/esm-browser/index.js +0 -9
- package/node_modules/uuid/dist/esm-browser/md5.js +0 -215
- package/node_modules/uuid/dist/esm-browser/native.js +0 -4
- package/node_modules/uuid/dist/esm-browser/nil.js +0 -1
- package/node_modules/uuid/dist/esm-browser/parse.js +0 -35
- package/node_modules/uuid/dist/esm-browser/regex.js +0 -1
- package/node_modules/uuid/dist/esm-browser/rng.js +0 -18
- package/node_modules/uuid/dist/esm-browser/sha1.js +0 -96
- package/node_modules/uuid/dist/esm-browser/stringify.js +0 -33
- package/node_modules/uuid/dist/esm-browser/v1.js +0 -95
- package/node_modules/uuid/dist/esm-browser/v3.js +0 -4
- package/node_modules/uuid/dist/esm-browser/v35.js +0 -66
- package/node_modules/uuid/dist/esm-browser/v4.js +0 -29
- package/node_modules/uuid/dist/esm-browser/v5.js +0 -4
- package/node_modules/uuid/dist/esm-browser/validate.js +0 -7
- package/node_modules/uuid/dist/esm-browser/version.js +0 -11
- package/node_modules/uuid/dist/esm-node/index.js +0 -9
- package/node_modules/uuid/dist/esm-node/md5.js +0 -13
- package/node_modules/uuid/dist/esm-node/native.js +0 -4
- package/node_modules/uuid/dist/esm-node/nil.js +0 -1
- package/node_modules/uuid/dist/esm-node/parse.js +0 -35
- package/node_modules/uuid/dist/esm-node/regex.js +0 -1
- package/node_modules/uuid/dist/esm-node/rng.js +0 -12
- package/node_modules/uuid/dist/esm-node/sha1.js +0 -13
- package/node_modules/uuid/dist/esm-node/stringify.js +0 -33
- package/node_modules/uuid/dist/esm-node/v1.js +0 -95
- package/node_modules/uuid/dist/esm-node/v3.js +0 -4
- package/node_modules/uuid/dist/esm-node/v35.js +0 -66
- package/node_modules/uuid/dist/esm-node/v4.js +0 -29
- package/node_modules/uuid/dist/esm-node/v5.js +0 -4
- package/node_modules/uuid/dist/esm-node/validate.js +0 -7
- package/node_modules/uuid/dist/esm-node/version.js +0 -11
- package/node_modules/uuid/dist/index.js +0 -79
- package/node_modules/uuid/dist/md5-browser.js +0 -223
- package/node_modules/uuid/dist/md5.js +0 -23
- package/node_modules/uuid/dist/native-browser.js +0 -11
- package/node_modules/uuid/dist/native.js +0 -15
- package/node_modules/uuid/dist/nil.js +0 -8
- package/node_modules/uuid/dist/parse.js +0 -45
- package/node_modules/uuid/dist/regex.js +0 -8
- package/node_modules/uuid/dist/rng-browser.js +0 -25
- package/node_modules/uuid/dist/rng.js +0 -24
- package/node_modules/uuid/dist/sha1-browser.js +0 -104
- package/node_modules/uuid/dist/sha1.js +0 -23
- package/node_modules/uuid/dist/stringify.js +0 -44
- package/node_modules/uuid/dist/uuid-bin.js +0 -85
- package/node_modules/uuid/dist/v1.js +0 -107
- package/node_modules/uuid/dist/v3.js +0 -16
- package/node_modules/uuid/dist/v35.js +0 -80
- package/node_modules/uuid/dist/v4.js +0 -43
- package/node_modules/uuid/dist/v5.js +0 -16
- package/node_modules/uuid/dist/validate.js +0 -17
- package/node_modules/uuid/dist/version.js +0 -21
- package/node_modules/uuid/package.json +0 -135
- package/node_modules/uuid/wrapper.mjs +0 -10
|
@@ -1,700 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Browsers' descriptors
|
|
3
|
-
*
|
|
4
|
-
* The idea of descriptors is simple. You should know about them two simple things:
|
|
5
|
-
* 1. Every descriptor has a method or property called `test` and a `describe` method.
|
|
6
|
-
* 2. Order of descriptors is important.
|
|
7
|
-
*
|
|
8
|
-
* More details:
|
|
9
|
-
* 1. Method or property `test` serves as a way to detect whether the UA string
|
|
10
|
-
* matches some certain browser or not. The `describe` method helps to make a result
|
|
11
|
-
* object with params that show some browser-specific things: name, version, etc.
|
|
12
|
-
* 2. Order of descriptors is important because a Parser goes through them one by one
|
|
13
|
-
* in course. For example, if you insert Chrome's descriptor as the first one,
|
|
14
|
-
* more then a half of browsers will be described as Chrome, because they will pass
|
|
15
|
-
* the Chrome descriptor's test.
|
|
16
|
-
*
|
|
17
|
-
* Descriptor's `test` could be a property with an array of RegExps, where every RegExp
|
|
18
|
-
* will be applied to a UA string to test it whether it matches or not.
|
|
19
|
-
* If a descriptor has two or more regexps in the `test` array it tests them one by one
|
|
20
|
-
* with a logical sum operation. Parser stops if it has found any RegExp that matches the UA.
|
|
21
|
-
*
|
|
22
|
-
* Or `test` could be a method. In that case it gets a Parser instance and should
|
|
23
|
-
* return true/false to get the Parser know if this browser descriptor matches the UA or not.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
import Utils from './utils.js';
|
|
27
|
-
|
|
28
|
-
const commonVersionIdentifier = /version\/(\d+(\.?_?\d+)+)/i;
|
|
29
|
-
|
|
30
|
-
const browsersList = [
|
|
31
|
-
/* Googlebot */
|
|
32
|
-
{
|
|
33
|
-
test: [/googlebot/i],
|
|
34
|
-
describe(ua) {
|
|
35
|
-
const browser = {
|
|
36
|
-
name: 'Googlebot',
|
|
37
|
-
};
|
|
38
|
-
const version = Utils.getFirstMatch(/googlebot\/(\d+(\.\d+))/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
39
|
-
|
|
40
|
-
if (version) {
|
|
41
|
-
browser.version = version;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return browser;
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
/* Opera < 13.0 */
|
|
49
|
-
{
|
|
50
|
-
test: [/opera/i],
|
|
51
|
-
describe(ua) {
|
|
52
|
-
const browser = {
|
|
53
|
-
name: 'Opera',
|
|
54
|
-
};
|
|
55
|
-
const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
56
|
-
|
|
57
|
-
if (version) {
|
|
58
|
-
browser.version = version;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return browser;
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
/* Opera > 13.0 */
|
|
66
|
-
{
|
|
67
|
-
test: [/opr\/|opios/i],
|
|
68
|
-
describe(ua) {
|
|
69
|
-
const browser = {
|
|
70
|
-
name: 'Opera',
|
|
71
|
-
};
|
|
72
|
-
const version = Utils.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
73
|
-
|
|
74
|
-
if (version) {
|
|
75
|
-
browser.version = version;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return browser;
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
test: [/SamsungBrowser/i],
|
|
83
|
-
describe(ua) {
|
|
84
|
-
const browser = {
|
|
85
|
-
name: 'Samsung Internet for Android',
|
|
86
|
-
};
|
|
87
|
-
const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
88
|
-
|
|
89
|
-
if (version) {
|
|
90
|
-
browser.version = version;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return browser;
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
test: [/Whale/i],
|
|
98
|
-
describe(ua) {
|
|
99
|
-
const browser = {
|
|
100
|
-
name: 'NAVER Whale Browser',
|
|
101
|
-
};
|
|
102
|
-
const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i, ua);
|
|
103
|
-
|
|
104
|
-
if (version) {
|
|
105
|
-
browser.version = version;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return browser;
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
test: [/MZBrowser/i],
|
|
113
|
-
describe(ua) {
|
|
114
|
-
const browser = {
|
|
115
|
-
name: 'MZ Browser',
|
|
116
|
-
};
|
|
117
|
-
const version = Utils.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
118
|
-
|
|
119
|
-
if (version) {
|
|
120
|
-
browser.version = version;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return browser;
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
test: [/focus/i],
|
|
128
|
-
describe(ua) {
|
|
129
|
-
const browser = {
|
|
130
|
-
name: 'Focus',
|
|
131
|
-
};
|
|
132
|
-
const version = Utils.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
133
|
-
|
|
134
|
-
if (version) {
|
|
135
|
-
browser.version = version;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return browser;
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
test: [/swing/i],
|
|
143
|
-
describe(ua) {
|
|
144
|
-
const browser = {
|
|
145
|
-
name: 'Swing',
|
|
146
|
-
};
|
|
147
|
-
const version = Utils.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
148
|
-
|
|
149
|
-
if (version) {
|
|
150
|
-
browser.version = version;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return browser;
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
test: [/coast/i],
|
|
158
|
-
describe(ua) {
|
|
159
|
-
const browser = {
|
|
160
|
-
name: 'Opera Coast',
|
|
161
|
-
};
|
|
162
|
-
const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
163
|
-
|
|
164
|
-
if (version) {
|
|
165
|
-
browser.version = version;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return browser;
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
test: [/opt\/\d+(?:.?_?\d+)+/i],
|
|
173
|
-
describe(ua) {
|
|
174
|
-
const browser = {
|
|
175
|
-
name: 'Opera Touch',
|
|
176
|
-
};
|
|
177
|
-
const version = Utils.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
178
|
-
|
|
179
|
-
if (version) {
|
|
180
|
-
browser.version = version;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
return browser;
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
test: [/yabrowser/i],
|
|
188
|
-
describe(ua) {
|
|
189
|
-
const browser = {
|
|
190
|
-
name: 'Yandex Browser',
|
|
191
|
-
};
|
|
192
|
-
const version = Utils.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
193
|
-
|
|
194
|
-
if (version) {
|
|
195
|
-
browser.version = version;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
return browser;
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
test: [/ucbrowser/i],
|
|
203
|
-
describe(ua) {
|
|
204
|
-
const browser = {
|
|
205
|
-
name: 'UC Browser',
|
|
206
|
-
};
|
|
207
|
-
const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
208
|
-
|
|
209
|
-
if (version) {
|
|
210
|
-
browser.version = version;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
return browser;
|
|
214
|
-
},
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
test: [/Maxthon|mxios/i],
|
|
218
|
-
describe(ua) {
|
|
219
|
-
const browser = {
|
|
220
|
-
name: 'Maxthon',
|
|
221
|
-
};
|
|
222
|
-
const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
223
|
-
|
|
224
|
-
if (version) {
|
|
225
|
-
browser.version = version;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
return browser;
|
|
229
|
-
},
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
test: [/epiphany/i],
|
|
233
|
-
describe(ua) {
|
|
234
|
-
const browser = {
|
|
235
|
-
name: 'Epiphany',
|
|
236
|
-
};
|
|
237
|
-
const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
238
|
-
|
|
239
|
-
if (version) {
|
|
240
|
-
browser.version = version;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
return browser;
|
|
244
|
-
},
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
test: [/puffin/i],
|
|
248
|
-
describe(ua) {
|
|
249
|
-
const browser = {
|
|
250
|
-
name: 'Puffin',
|
|
251
|
-
};
|
|
252
|
-
const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
253
|
-
|
|
254
|
-
if (version) {
|
|
255
|
-
browser.version = version;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
return browser;
|
|
259
|
-
},
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
test: [/sleipnir/i],
|
|
263
|
-
describe(ua) {
|
|
264
|
-
const browser = {
|
|
265
|
-
name: 'Sleipnir',
|
|
266
|
-
};
|
|
267
|
-
const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
268
|
-
|
|
269
|
-
if (version) {
|
|
270
|
-
browser.version = version;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
return browser;
|
|
274
|
-
},
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
test: [/k-meleon/i],
|
|
278
|
-
describe(ua) {
|
|
279
|
-
const browser = {
|
|
280
|
-
name: 'K-Meleon',
|
|
281
|
-
};
|
|
282
|
-
const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
283
|
-
|
|
284
|
-
if (version) {
|
|
285
|
-
browser.version = version;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
return browser;
|
|
289
|
-
},
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
test: [/micromessenger/i],
|
|
293
|
-
describe(ua) {
|
|
294
|
-
const browser = {
|
|
295
|
-
name: 'WeChat',
|
|
296
|
-
};
|
|
297
|
-
const version = Utils.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
298
|
-
|
|
299
|
-
if (version) {
|
|
300
|
-
browser.version = version;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
return browser;
|
|
304
|
-
},
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
test: [/qqbrowser/i],
|
|
308
|
-
describe(ua) {
|
|
309
|
-
const browser = {
|
|
310
|
-
name: (/qqbrowserlite/i).test(ua) ? 'QQ Browser Lite' : 'QQ Browser',
|
|
311
|
-
};
|
|
312
|
-
const version = Utils.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
313
|
-
|
|
314
|
-
if (version) {
|
|
315
|
-
browser.version = version;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
return browser;
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
test: [/msie|trident/i],
|
|
323
|
-
describe(ua) {
|
|
324
|
-
const browser = {
|
|
325
|
-
name: 'Internet Explorer',
|
|
326
|
-
};
|
|
327
|
-
const version = Utils.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i, ua);
|
|
328
|
-
|
|
329
|
-
if (version) {
|
|
330
|
-
browser.version = version;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
return browser;
|
|
334
|
-
},
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
test: [/\sedg\//i],
|
|
338
|
-
describe(ua) {
|
|
339
|
-
const browser = {
|
|
340
|
-
name: 'Microsoft Edge',
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
const version = Utils.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i, ua);
|
|
344
|
-
|
|
345
|
-
if (version) {
|
|
346
|
-
browser.version = version;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
return browser;
|
|
350
|
-
},
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
test: [/edg([ea]|ios)/i],
|
|
354
|
-
describe(ua) {
|
|
355
|
-
const browser = {
|
|
356
|
-
name: 'Microsoft Edge',
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
const version = Utils.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i, ua);
|
|
360
|
-
|
|
361
|
-
if (version) {
|
|
362
|
-
browser.version = version;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
return browser;
|
|
366
|
-
},
|
|
367
|
-
},
|
|
368
|
-
{
|
|
369
|
-
test: [/vivaldi/i],
|
|
370
|
-
describe(ua) {
|
|
371
|
-
const browser = {
|
|
372
|
-
name: 'Vivaldi',
|
|
373
|
-
};
|
|
374
|
-
const version = Utils.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i, ua);
|
|
375
|
-
|
|
376
|
-
if (version) {
|
|
377
|
-
browser.version = version;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
return browser;
|
|
381
|
-
},
|
|
382
|
-
},
|
|
383
|
-
{
|
|
384
|
-
test: [/seamonkey/i],
|
|
385
|
-
describe(ua) {
|
|
386
|
-
const browser = {
|
|
387
|
-
name: 'SeaMonkey',
|
|
388
|
-
};
|
|
389
|
-
const version = Utils.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i, ua);
|
|
390
|
-
|
|
391
|
-
if (version) {
|
|
392
|
-
browser.version = version;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
return browser;
|
|
396
|
-
},
|
|
397
|
-
},
|
|
398
|
-
{
|
|
399
|
-
test: [/sailfish/i],
|
|
400
|
-
describe(ua) {
|
|
401
|
-
const browser = {
|
|
402
|
-
name: 'Sailfish',
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
const version = Utils.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i, ua);
|
|
406
|
-
|
|
407
|
-
if (version) {
|
|
408
|
-
browser.version = version;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
return browser;
|
|
412
|
-
},
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
test: [/silk/i],
|
|
416
|
-
describe(ua) {
|
|
417
|
-
const browser = {
|
|
418
|
-
name: 'Amazon Silk',
|
|
419
|
-
};
|
|
420
|
-
const version = Utils.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i, ua);
|
|
421
|
-
|
|
422
|
-
if (version) {
|
|
423
|
-
browser.version = version;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
return browser;
|
|
427
|
-
},
|
|
428
|
-
},
|
|
429
|
-
{
|
|
430
|
-
test: [/phantom/i],
|
|
431
|
-
describe(ua) {
|
|
432
|
-
const browser = {
|
|
433
|
-
name: 'PhantomJS',
|
|
434
|
-
};
|
|
435
|
-
const version = Utils.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i, ua);
|
|
436
|
-
|
|
437
|
-
if (version) {
|
|
438
|
-
browser.version = version;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
return browser;
|
|
442
|
-
},
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
test: [/slimerjs/i],
|
|
446
|
-
describe(ua) {
|
|
447
|
-
const browser = {
|
|
448
|
-
name: 'SlimerJS',
|
|
449
|
-
};
|
|
450
|
-
const version = Utils.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i, ua);
|
|
451
|
-
|
|
452
|
-
if (version) {
|
|
453
|
-
browser.version = version;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
return browser;
|
|
457
|
-
},
|
|
458
|
-
},
|
|
459
|
-
{
|
|
460
|
-
test: [/blackberry|\bbb\d+/i, /rim\stablet/i],
|
|
461
|
-
describe(ua) {
|
|
462
|
-
const browser = {
|
|
463
|
-
name: 'BlackBerry',
|
|
464
|
-
};
|
|
465
|
-
const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i, ua);
|
|
466
|
-
|
|
467
|
-
if (version) {
|
|
468
|
-
browser.version = version;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
return browser;
|
|
472
|
-
},
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
test: [/(web|hpw)[o0]s/i],
|
|
476
|
-
describe(ua) {
|
|
477
|
-
const browser = {
|
|
478
|
-
name: 'WebOS Browser',
|
|
479
|
-
};
|
|
480
|
-
const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i, ua);
|
|
481
|
-
|
|
482
|
-
if (version) {
|
|
483
|
-
browser.version = version;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
return browser;
|
|
487
|
-
},
|
|
488
|
-
},
|
|
489
|
-
{
|
|
490
|
-
test: [/bada/i],
|
|
491
|
-
describe(ua) {
|
|
492
|
-
const browser = {
|
|
493
|
-
name: 'Bada',
|
|
494
|
-
};
|
|
495
|
-
const version = Utils.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i, ua);
|
|
496
|
-
|
|
497
|
-
if (version) {
|
|
498
|
-
browser.version = version;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
return browser;
|
|
502
|
-
},
|
|
503
|
-
},
|
|
504
|
-
{
|
|
505
|
-
test: [/tizen/i],
|
|
506
|
-
describe(ua) {
|
|
507
|
-
const browser = {
|
|
508
|
-
name: 'Tizen',
|
|
509
|
-
};
|
|
510
|
-
const version = Utils.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
511
|
-
|
|
512
|
-
if (version) {
|
|
513
|
-
browser.version = version;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
return browser;
|
|
517
|
-
},
|
|
518
|
-
},
|
|
519
|
-
{
|
|
520
|
-
test: [/qupzilla/i],
|
|
521
|
-
describe(ua) {
|
|
522
|
-
const browser = {
|
|
523
|
-
name: 'QupZilla',
|
|
524
|
-
};
|
|
525
|
-
const version = Utils.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
526
|
-
|
|
527
|
-
if (version) {
|
|
528
|
-
browser.version = version;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
return browser;
|
|
532
|
-
},
|
|
533
|
-
},
|
|
534
|
-
{
|
|
535
|
-
test: [/firefox|iceweasel|fxios/i],
|
|
536
|
-
describe(ua) {
|
|
537
|
-
const browser = {
|
|
538
|
-
name: 'Firefox',
|
|
539
|
-
};
|
|
540
|
-
const version = Utils.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
541
|
-
|
|
542
|
-
if (version) {
|
|
543
|
-
browser.version = version;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
return browser;
|
|
547
|
-
},
|
|
548
|
-
},
|
|
549
|
-
{
|
|
550
|
-
test: [/electron/i],
|
|
551
|
-
describe(ua) {
|
|
552
|
-
const browser = {
|
|
553
|
-
name: 'Electron',
|
|
554
|
-
};
|
|
555
|
-
const version = Utils.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i, ua);
|
|
556
|
-
|
|
557
|
-
if (version) {
|
|
558
|
-
browser.version = version;
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
return browser;
|
|
562
|
-
},
|
|
563
|
-
},
|
|
564
|
-
{
|
|
565
|
-
test: [/MiuiBrowser/i],
|
|
566
|
-
describe(ua) {
|
|
567
|
-
const browser = {
|
|
568
|
-
name: 'Miui',
|
|
569
|
-
};
|
|
570
|
-
const version = Utils.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
571
|
-
|
|
572
|
-
if (version) {
|
|
573
|
-
browser.version = version;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
return browser;
|
|
577
|
-
},
|
|
578
|
-
},
|
|
579
|
-
{
|
|
580
|
-
test: [/chromium/i],
|
|
581
|
-
describe(ua) {
|
|
582
|
-
const browser = {
|
|
583
|
-
name: 'Chromium',
|
|
584
|
-
};
|
|
585
|
-
const version = Utils.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
586
|
-
|
|
587
|
-
if (version) {
|
|
588
|
-
browser.version = version;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
return browser;
|
|
592
|
-
},
|
|
593
|
-
},
|
|
594
|
-
{
|
|
595
|
-
test: [/chrome|crios|crmo/i],
|
|
596
|
-
describe(ua) {
|
|
597
|
-
const browser = {
|
|
598
|
-
name: 'Chrome',
|
|
599
|
-
};
|
|
600
|
-
const version = Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, ua);
|
|
601
|
-
|
|
602
|
-
if (version) {
|
|
603
|
-
browser.version = version;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
return browser;
|
|
607
|
-
},
|
|
608
|
-
},
|
|
609
|
-
{
|
|
610
|
-
test: [/GSA/i],
|
|
611
|
-
describe(ua) {
|
|
612
|
-
const browser = {
|
|
613
|
-
name: 'Google Search',
|
|
614
|
-
};
|
|
615
|
-
const version = Utils.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i, ua);
|
|
616
|
-
|
|
617
|
-
if (version) {
|
|
618
|
-
browser.version = version;
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
return browser;
|
|
622
|
-
},
|
|
623
|
-
},
|
|
624
|
-
|
|
625
|
-
/* Android Browser */
|
|
626
|
-
{
|
|
627
|
-
test(parser) {
|
|
628
|
-
const notLikeAndroid = !parser.test(/like android/i);
|
|
629
|
-
const butAndroid = parser.test(/android/i);
|
|
630
|
-
return notLikeAndroid && butAndroid;
|
|
631
|
-
},
|
|
632
|
-
describe(ua) {
|
|
633
|
-
const browser = {
|
|
634
|
-
name: 'Android Browser',
|
|
635
|
-
};
|
|
636
|
-
const version = Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
637
|
-
|
|
638
|
-
if (version) {
|
|
639
|
-
browser.version = version;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
return browser;
|
|
643
|
-
},
|
|
644
|
-
},
|
|
645
|
-
|
|
646
|
-
/* PlayStation 4 */
|
|
647
|
-
{
|
|
648
|
-
test: [/playstation 4/i],
|
|
649
|
-
describe(ua) {
|
|
650
|
-
const browser = {
|
|
651
|
-
name: 'PlayStation 4',
|
|
652
|
-
};
|
|
653
|
-
const version = Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
654
|
-
|
|
655
|
-
if (version) {
|
|
656
|
-
browser.version = version;
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
return browser;
|
|
660
|
-
},
|
|
661
|
-
},
|
|
662
|
-
|
|
663
|
-
/* Safari */
|
|
664
|
-
{
|
|
665
|
-
test: [/safari|applewebkit/i],
|
|
666
|
-
describe(ua) {
|
|
667
|
-
const browser = {
|
|
668
|
-
name: 'Safari',
|
|
669
|
-
};
|
|
670
|
-
const version = Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
671
|
-
|
|
672
|
-
if (version) {
|
|
673
|
-
browser.version = version;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
return browser;
|
|
677
|
-
},
|
|
678
|
-
},
|
|
679
|
-
|
|
680
|
-
/* Something else */
|
|
681
|
-
{
|
|
682
|
-
test: [/.*/i],
|
|
683
|
-
describe(ua) {
|
|
684
|
-
/* Here we try to make sure that there are explicit details about the device
|
|
685
|
-
* in order to decide what regexp exactly we want to apply
|
|
686
|
-
* (as there is a specific decision based on that conclusion)
|
|
687
|
-
*/
|
|
688
|
-
const regexpWithoutDeviceSpec = /^(.*)\/(.*) /;
|
|
689
|
-
const regexpWithDeviceSpec = /^(.*)\/(.*)[ \t]\((.*)/;
|
|
690
|
-
const hasDeviceSpec = ua.search('\\(') !== -1;
|
|
691
|
-
const regexp = hasDeviceSpec ? regexpWithDeviceSpec : regexpWithoutDeviceSpec;
|
|
692
|
-
return {
|
|
693
|
-
name: Utils.getFirstMatch(regexp, ua),
|
|
694
|
-
version: Utils.getSecondMatch(regexp, ua),
|
|
695
|
-
};
|
|
696
|
-
},
|
|
697
|
-
},
|
|
698
|
-
];
|
|
699
|
-
|
|
700
|
-
export default browsersList;
|