@newrelic/browser-agent 1.232.0 → 1.233.0
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/dist/cjs/cdn/polyfills.js +5 -2
- package/dist/cjs/common/config/state/configurable.js +15 -26
- package/dist/cjs/common/config/state/info.js +1 -1
- package/dist/cjs/common/config/state/init.js +101 -56
- package/dist/cjs/common/config/state/loader-config.js +1 -1
- package/dist/cjs/common/config/state/runtime.js +1 -5
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/drain/drain.js +1 -1
- package/dist/cjs/common/harvest/harvest-scheduler.js +30 -10
- package/dist/cjs/common/harvest/harvest.js +119 -55
- package/dist/cjs/common/session/session-entity.js +35 -22
- package/dist/cjs/common/session/session-entity.test.js +73 -49
- package/dist/cjs/common/timer/interaction-timer.js +9 -12
- package/dist/cjs/common/url/canonicalize-url.js +32 -0
- package/dist/cjs/common/url/canonicalize-url.test.js +42 -0
- package/dist/cjs/common/url/clean-url.js +10 -3
- package/dist/cjs/common/url/protocol.test.js +0 -1
- package/dist/cjs/common/util/feature-flags.js +2 -1
- package/dist/cjs/common/util/global-scope.js +4 -2
- package/dist/cjs/common/util/submit-data.js +57 -18
- package/dist/cjs/common/wrap/wrap-fetch.js +1 -3
- package/dist/cjs/common/wrap/wrap-function.js +1 -3
- package/dist/cjs/common/wrap/wrap-promise.js +1 -1
- package/dist/cjs/features/ajax/aggregate/index.js +2 -2
- package/dist/cjs/features/ajax/instrument/index.js +1 -1
- package/dist/cjs/features/jserrors/aggregate/canonical-function-name.js +12 -4
- package/dist/cjs/features/jserrors/aggregate/compute-stack-trace.js +93 -10
- package/dist/cjs/features/jserrors/aggregate/compute-stack-trace.test.js +164 -38
- package/dist/cjs/features/jserrors/aggregate/index.js +29 -48
- package/dist/cjs/features/jserrors/instrument/index.js +0 -2
- package/dist/cjs/features/metrics/aggregate/framework-detection.js +67 -0
- package/dist/cjs/features/metrics/aggregate/framework-detection.test.js +137 -0
- package/dist/cjs/features/metrics/aggregate/index.js +7 -3
- package/dist/cjs/features/metrics/aggregate/polyfill-detection.es5.js +14 -0
- package/dist/cjs/features/metrics/aggregate/polyfill-detection.es5.test.js +17 -0
- package/dist/cjs/features/metrics/aggregate/polyfill-detection.js +53 -0
- package/dist/cjs/features/metrics/aggregate/polyfill-detection.test.js +165 -0
- package/dist/cjs/features/page_action/aggregate/index.js +2 -2
- package/dist/cjs/features/page_view_event/aggregate/index.js +6 -3
- package/dist/cjs/features/page_view_timing/aggregate/index.js +2 -2
- package/dist/cjs/features/session_replay/aggregate/index.js +333 -0
- package/dist/cjs/features/session_replay/constants.js +9 -0
- package/dist/cjs/features/session_replay/index.js +12 -0
- package/dist/cjs/features/session_replay/instrument/index.js +29 -0
- package/dist/cjs/features/session_trace/aggregate/index.js +163 -164
- package/dist/cjs/features/session_trace/constants.js +2 -9
- package/dist/cjs/features/session_trace/instrument/index.js +24 -66
- package/dist/cjs/features/spa/aggregate/index.js +2 -2
- package/dist/cjs/features/utils/agent-session.js +1 -2
- package/dist/cjs/features/utils/aggregate-base.js +64 -0
- package/dist/cjs/features/utils/feature-base.js +0 -31
- package/dist/cjs/features/utils/handler-cache.js +3 -4
- package/dist/cjs/features/utils/instrument-base.js +42 -10
- package/dist/cjs/features/utils/{lazy-loader.js → lazy-feature-loader.js} +4 -2
- package/dist/cjs/loaders/agent.js +1 -1
- package/dist/cjs/loaders/api/apiAsync.js +3 -1
- package/dist/cjs/loaders/configure/configure.js +3 -3
- package/dist/cjs/loaders/features/featureDependencies.js +0 -12
- package/dist/cjs/loaders/features/features.js +3 -1
- package/dist/cjs/loaders/micro-agent.js +6 -6
- package/dist/esm/cdn/polyfills.js +5 -2
- package/dist/esm/common/config/state/configurable.js +14 -24
- package/dist/esm/common/config/state/info.js +2 -2
- package/dist/esm/common/config/state/init.js +102 -57
- package/dist/esm/common/config/state/loader-config.js +2 -2
- package/dist/esm/common/config/state/runtime.js +2 -4
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/drain/drain.js +1 -1
- package/dist/esm/common/harvest/harvest-scheduler.js +30 -10
- package/dist/esm/common/harvest/harvest.js +121 -56
- package/dist/esm/common/session/session-entity.js +35 -22
- package/dist/esm/common/session/session-entity.test.js +73 -49
- package/dist/esm/common/timer/interaction-timer.js +9 -12
- package/dist/esm/common/url/canonicalize-url.js +27 -0
- package/dist/esm/common/url/canonicalize-url.test.js +38 -0
- package/dist/esm/common/url/clean-url.js +10 -3
- package/dist/esm/common/url/protocol.test.js +0 -1
- package/dist/esm/common/util/feature-flags.js +2 -1
- package/dist/esm/common/util/global-scope.js +1 -0
- package/dist/esm/common/util/submit-data.js +57 -18
- package/dist/esm/common/wrap/wrap-fetch.js +1 -2
- package/dist/esm/common/wrap/wrap-function.js +1 -2
- package/dist/esm/common/wrap/wrap-promise.js +1 -1
- package/dist/esm/features/ajax/aggregate/index.js +2 -2
- package/dist/esm/features/ajax/instrument/index.js +1 -1
- package/dist/esm/features/jserrors/aggregate/canonical-function-name.js +12 -4
- package/dist/esm/features/jserrors/aggregate/compute-stack-trace.js +93 -10
- package/dist/esm/features/jserrors/aggregate/compute-stack-trace.test.js +149 -25
- package/dist/esm/features/jserrors/aggregate/index.js +30 -48
- package/dist/esm/features/jserrors/instrument/index.js +0 -1
- package/dist/esm/features/metrics/aggregate/framework-detection.js +61 -0
- package/dist/esm/features/metrics/aggregate/framework-detection.test.js +133 -0
- package/dist/esm/features/metrics/aggregate/index.js +7 -3
- package/dist/esm/features/metrics/aggregate/polyfill-detection.es5.js +8 -0
- package/dist/esm/features/metrics/aggregate/polyfill-detection.es5.test.js +15 -0
- package/dist/esm/features/metrics/aggregate/polyfill-detection.js +47 -0
- package/dist/esm/features/metrics/aggregate/polyfill-detection.test.js +163 -0
- package/dist/esm/features/page_action/aggregate/index.js +2 -2
- package/dist/esm/features/page_view_event/aggregate/index.js +6 -3
- package/dist/esm/features/page_view_timing/aggregate/index.js +2 -2
- package/dist/esm/features/session_replay/aggregate/index.js +327 -0
- package/dist/esm/features/session_replay/constants.js +2 -0
- package/dist/esm/features/session_replay/index.js +12 -0
- package/dist/esm/features/session_replay/instrument/index.js +21 -0
- package/dist/esm/features/session_trace/aggregate/index.js +163 -163
- package/dist/esm/features/session_trace/constants.js +1 -5
- package/dist/esm/features/session_trace/instrument/index.js +24 -66
- package/dist/esm/features/spa/aggregate/index.js +2 -2
- package/dist/esm/features/utils/agent-session.js +1 -2
- package/dist/esm/features/utils/aggregate-base.js +57 -0
- package/dist/esm/features/utils/feature-base.js +1 -32
- package/dist/esm/features/utils/handler-cache.js +3 -4
- package/dist/esm/features/utils/instrument-base.js +42 -10
- package/dist/esm/features/utils/{lazy-loader.js → lazy-feature-loader.js} +3 -1
- package/dist/esm/loaders/agent.js +1 -1
- package/dist/esm/loaders/api/apiAsync.js +3 -1
- package/dist/esm/loaders/configure/configure.js +3 -3
- package/dist/esm/loaders/features/featureDependencies.js +0 -11
- package/dist/esm/loaders/features/features.js +3 -1
- package/dist/esm/loaders/micro-agent.js +6 -6
- package/dist/types/common/config/state/configurable.d.ts +1 -3
- package/dist/types/common/config/state/configurable.d.ts.map +1 -1
- package/dist/types/common/config/state/init.d.ts.map +1 -1
- package/dist/types/common/config/state/runtime.d.ts.map +1 -1
- package/dist/types/common/harvest/harvest-scheduler.d.ts.map +1 -1
- package/dist/types/common/harvest/harvest.d.ts +37 -34
- package/dist/types/common/harvest/harvest.d.ts.map +1 -1
- package/dist/types/common/session/session-entity.d.ts +6 -3
- package/dist/types/common/session/session-entity.d.ts.map +1 -1
- package/dist/types/common/timer/interaction-timer.d.ts +2 -1
- package/dist/types/common/timer/interaction-timer.d.ts.map +1 -1
- package/dist/types/common/url/canonicalize-url.d.ts +9 -0
- package/dist/types/common/url/canonicalize-url.d.ts.map +1 -0
- package/dist/types/common/url/clean-url.d.ts +7 -1
- package/dist/types/common/url/clean-url.d.ts.map +1 -1
- package/dist/types/common/util/feature-flags.d.ts.map +1 -1
- package/dist/types/common/util/global-scope.d.ts +1 -0
- package/dist/types/common/util/global-scope.d.ts.map +1 -1
- package/dist/types/common/util/submit-data.d.ts +40 -14
- package/dist/types/common/util/submit-data.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-fetch.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-function.d.ts.map +1 -1
- package/dist/types/features/ajax/aggregate/index.d.ts +2 -2
- package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/jserrors/aggregate/canonical-function-name.d.ts +8 -1
- package/dist/types/features/jserrors/aggregate/canonical-function-name.d.ts.map +1 -1
- package/dist/types/features/jserrors/aggregate/compute-stack-trace.d.ts +48 -19
- package/dist/types/features/jserrors/aggregate/compute-stack-trace.d.ts.map +1 -1
- package/dist/types/features/jserrors/aggregate/index.d.ts +14 -5
- package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/jserrors/instrument/index.d.ts.map +1 -1
- package/dist/types/features/metrics/aggregate/framework-detection.d.ts.map +1 -0
- package/dist/types/features/metrics/aggregate/index.d.ts +2 -2
- package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/metrics/aggregate/polyfill-detection.d.ts +6 -0
- package/dist/types/features/metrics/aggregate/polyfill-detection.d.ts.map +1 -0
- package/dist/types/features/metrics/aggregate/polyfill-detection.es5.d.ts +7 -0
- package/dist/types/features/metrics/aggregate/polyfill-detection.es5.d.ts.map +1 -0
- package/dist/types/features/page_action/aggregate/index.d.ts +3 -3
- package/dist/types/features/page_action/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_view_event/aggregate/index.d.ts +2 -2
- package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_view_timing/aggregate/index.d.ts +2 -2
- package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_replay/aggregate/index.d.ts +96 -0
- package/dist/types/features/session_replay/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/session_replay/constants.d.ts +2 -0
- package/dist/types/features/session_replay/constants.d.ts.map +1 -0
- package/dist/types/features/session_replay/index.d.ts +2 -0
- package/dist/types/features/session_replay/index.d.ts.map +1 -0
- package/dist/types/features/session_replay/instrument/index.d.ts +6 -0
- package/dist/types/features/session_replay/instrument/index.d.ts.map +1 -0
- package/dist/types/features/session_trace/aggregate/index.d.ts +8 -57
- package/dist/types/features/session_trace/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_trace/constants.d.ts +0 -3
- package/dist/types/features/session_trace/constants.d.ts.map +1 -1
- package/dist/types/features/session_trace/instrument/index.d.ts +1 -3
- package/dist/types/features/session_trace/instrument/index.d.ts.map +1 -1
- package/dist/types/features/spa/aggregate/index.d.ts +2 -2
- package/dist/types/features/spa/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/utils/agent-session.d.ts.map +1 -1
- package/dist/types/features/utils/aggregate-base.d.ts +11 -0
- package/dist/types/features/utils/aggregate-base.d.ts.map +1 -0
- package/dist/types/features/utils/feature-base.d.ts +0 -5
- package/dist/types/features/utils/feature-base.d.ts.map +1 -1
- package/dist/types/features/utils/handler-cache.d.ts.map +1 -1
- package/dist/types/features/utils/instrument-base.d.ts +3 -1
- package/dist/types/features/utils/instrument-base.d.ts.map +1 -1
- package/dist/types/features/utils/{lazy-loader.d.ts → lazy-feature-loader.d.ts} +2 -2
- package/dist/types/features/utils/lazy-feature-loader.d.ts.map +1 -0
- package/dist/types/loaders/configure/configure.d.ts.map +1 -1
- package/dist/types/loaders/features/featureDependencies.d.ts +0 -1
- package/dist/types/loaders/features/featureDependencies.d.ts.map +1 -1
- package/dist/types/loaders/features/features.d.ts +1 -0
- package/dist/types/loaders/features/features.d.ts.map +1 -1
- package/package.json +31 -22
- package/src/cdn/polyfills.js +4 -1
- package/src/common/config/state/configurable.js +18 -24
- package/src/common/config/state/info.js +2 -2
- package/src/common/config/state/init.js +62 -28
- package/src/common/config/state/loader-config.js +2 -2
- package/src/common/config/state/runtime.js +2 -4
- package/src/common/drain/drain.js +1 -1
- package/src/common/harvest/harvest-scheduler.js +35 -10
- package/src/common/harvest/harvest.js +73 -50
- package/src/common/session/session-entity.js +34 -23
- package/src/common/session/session-entity.test.js +57 -51
- package/src/common/timer/interaction-timer.js +9 -12
- package/src/common/url/canonicalize-url.js +28 -0
- package/src/common/url/canonicalize-url.test.js +34 -0
- package/src/common/url/clean-url.js +10 -3
- package/src/common/url/protocol.test.js +0 -1
- package/src/common/util/feature-flags.js +2 -2
- package/src/common/util/global-scope.js +2 -0
- package/src/common/util/submit-data.js +28 -17
- package/src/common/wrap/wrap-fetch.js +1 -2
- package/src/common/wrap/wrap-function.js +1 -2
- package/src/common/wrap/wrap-promise.js +1 -1
- package/src/features/ajax/aggregate/index.js +2 -2
- package/src/features/ajax/instrument/index.js +1 -1
- package/src/features/jserrors/aggregate/canonical-function-name.js +12 -4
- package/src/features/jserrors/aggregate/compute-stack-trace.js +85 -11
- package/src/features/jserrors/aggregate/compute-stack-trace.test.js +141 -24
- package/src/features/jserrors/aggregate/index.js +28 -52
- package/src/features/jserrors/instrument/index.js +0 -1
- package/src/features/metrics/aggregate/framework-detection.js +73 -0
- package/src/features/metrics/aggregate/framework-detection.test.js +201 -0
- package/src/features/metrics/aggregate/index.js +8 -3
- package/src/features/metrics/aggregate/polyfill-detection.es5.js +9 -0
- package/src/features/metrics/aggregate/polyfill-detection.es5.test.js +16 -0
- package/src/features/metrics/aggregate/polyfill-detection.js +48 -0
- package/src/features/metrics/aggregate/polyfill-detection.test.js +163 -0
- package/src/features/page_action/aggregate/index.js +2 -2
- package/src/features/page_view_event/aggregate/index.js +5 -5
- package/src/features/page_view_timing/aggregate/index.js +2 -2
- package/src/features/session_replay/aggregate/index.js +314 -0
- package/src/features/session_replay/constants.js +3 -0
- package/src/features/session_replay/index.js +12 -0
- package/src/features/session_replay/instrument/index.js +22 -0
- package/src/features/session_trace/aggregate/index.js +148 -188
- package/src/features/session_trace/constants.js +0 -4
- package/src/features/session_trace/instrument/index.js +17 -69
- package/src/features/spa/aggregate/index.js +2 -2
- package/src/features/utils/agent-session.js +1 -2
- package/src/features/utils/aggregate-base.js +51 -0
- package/src/features/utils/feature-base.js +1 -31
- package/src/features/utils/handler-cache.js +3 -4
- package/src/features/utils/instrument-base.js +40 -8
- package/src/features/utils/{lazy-loader.js → lazy-feature-loader.js} +3 -1
- package/src/loaders/agent.js +1 -1
- package/src/loaders/api/apiAsync.js +1 -1
- package/src/loaders/configure/configure.js +4 -3
- package/src/loaders/features/featureDependencies.js +0 -12
- package/src/loaders/features/features.js +3 -1
- package/src/loaders/micro-agent.js +4 -4
- package/dist/cjs/common/metrics/framework-detection.js +0 -72
- package/dist/cjs/common/util/user-agent.js +0 -57
- package/dist/cjs/common/window/supports-performance-observer.js +0 -15
- package/dist/esm/common/metrics/framework-detection.js +0 -66
- package/dist/esm/common/util/user-agent.js +0 -48
- package/dist/esm/common/window/supports-performance-observer.js +0 -9
- package/dist/types/common/metrics/framework-detection.d.ts.map +0 -1
- package/dist/types/common/util/user-agent.d.ts +0 -5
- package/dist/types/common/util/user-agent.d.ts.map +0 -1
- package/dist/types/common/window/supports-performance-observer.d.ts +0 -2
- package/dist/types/common/window/supports-performance-observer.d.ts.map +0 -1
- package/dist/types/features/utils/lazy-loader.d.ts.map +0 -1
- package/src/common/metrics/framework-detection.js +0 -71
- package/src/common/util/user-agent.js +0 -56
- package/src/common/window/supports-performance-observer.js +0 -10
- /package/dist/types/{common/metrics → features/metrics/aggregate}/framework-detection.d.ts +0 -0
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { isBrowserScope } from '../util/global-scope';
|
|
2
|
-
var FRAMEWORKS = {
|
|
3
|
-
REACT: 'React',
|
|
4
|
-
ANGULAR: 'Angular',
|
|
5
|
-
ANGULARJS: 'AngularJS',
|
|
6
|
-
BACKBONE: 'Backbone',
|
|
7
|
-
EMBER: 'Ember',
|
|
8
|
-
VUE: 'Vue',
|
|
9
|
-
METEOR: 'Meteor',
|
|
10
|
-
ZEPTO: 'Zepto',
|
|
11
|
-
JQUERY: 'Jquery'
|
|
12
|
-
};
|
|
13
|
-
export function getFrameworks() {
|
|
14
|
-
if (!isBrowserScope) return []; // don't bother detecting frameworks if not in the main window context
|
|
15
|
-
|
|
16
|
-
var frameworks = [];
|
|
17
|
-
try {
|
|
18
|
-
if (detectReact()) frameworks.push(FRAMEWORKS.REACT);
|
|
19
|
-
if (detectAngularJs()) frameworks.push(FRAMEWORKS.ANGULARJS);
|
|
20
|
-
if (detectAngular()) frameworks.push(FRAMEWORKS.ANGULAR);
|
|
21
|
-
if (window.Backbone) frameworks.push(FRAMEWORKS.BACKBONE);
|
|
22
|
-
if (window.Ember) frameworks.push(FRAMEWORKS.EMBER);
|
|
23
|
-
if (window.Vue) frameworks.push(FRAMEWORKS.VUE);
|
|
24
|
-
if (window.Meteor) frameworks.push(FRAMEWORKS.METEOR);
|
|
25
|
-
if (window.Zepto) frameworks.push(FRAMEWORKS.ZEPTO);
|
|
26
|
-
if (window.jQuery) frameworks.push(FRAMEWORKS.JQUERY);
|
|
27
|
-
} catch (err) {
|
|
28
|
-
// not supported?
|
|
29
|
-
}
|
|
30
|
-
return frameworks;
|
|
31
|
-
}
|
|
32
|
-
function detectReact() {
|
|
33
|
-
try {
|
|
34
|
-
if (!!window.React || !!window.ReactDOM || !!window.ReactRedux) return true;
|
|
35
|
-
if (document.querySelector('[data-reactroot], [data-reactid]')) return true;
|
|
36
|
-
var divs = document.querySelectorAll('body > div');
|
|
37
|
-
for (var i = 0; i < divs.length; i++) {
|
|
38
|
-
if (Object.keys(divs[i]).indexOf('_reactRootContainer') >= 0) return true;
|
|
39
|
-
}
|
|
40
|
-
return false;
|
|
41
|
-
} catch (err) {
|
|
42
|
-
// not supported?
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function detectAngularJs() {
|
|
47
|
-
try {
|
|
48
|
-
if (window.angular) return true;
|
|
49
|
-
if (document.querySelector('.ng-binding, [ng-app], [data-ng-app], [ng-controller], [data-ng-controller], [ng-repeat], [data-ng-repeat]')) return true;
|
|
50
|
-
if (document.querySelector('script[src*="angular.js"], script[src*="angular.min.js"]')) return true;
|
|
51
|
-
return false;
|
|
52
|
-
} catch (err) {
|
|
53
|
-
// not supported?
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function detectAngular() {
|
|
58
|
-
try {
|
|
59
|
-
// eslint-disable-next-line
|
|
60
|
-
if (window.hasOwnProperty('ng') && window.ng.hasOwnProperty('coreTokens') && window.ng.coreTokens.hasOwnProperty('NgZone')) return true;
|
|
61
|
-
return !!document.querySelectorAll('[ng-version]').length;
|
|
62
|
-
} catch (err) {
|
|
63
|
-
// not supported?
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// Feature-detection is much preferred over using User Agent to detect browser.
|
|
7
|
-
// However, there are cases where feature detection is not possible, for example
|
|
8
|
-
// when a specific version of a browser has a bug that requires a workaround in just
|
|
9
|
-
// that version.
|
|
10
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Browser_Name
|
|
11
|
-
var agentName = null;
|
|
12
|
-
var agentVersion = null;
|
|
13
|
-
const safari = /Version\/(\S+)\s+Safari/;
|
|
14
|
-
if (navigator.userAgent) {
|
|
15
|
-
var userAgent = navigator.userAgent;
|
|
16
|
-
var parts = userAgent.match(safari);
|
|
17
|
-
if (parts && userAgent.indexOf('Chrome') === -1 && userAgent.indexOf('Chromium') === -1) {
|
|
18
|
-
agentName = 'Safari';
|
|
19
|
-
agentVersion = parts[1];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export { agentName as agent, agentVersion as version };
|
|
23
|
-
export function match(name, version) {
|
|
24
|
-
if (!agentName) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
if (name !== agentName) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// version not provided, only match by name
|
|
32
|
-
if (!version) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// version provided, but not detected - not reliable match
|
|
37
|
-
if (!agentVersion) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
var detectedParts = agentVersion.split('.');
|
|
41
|
-
var requestedParts = version.split('.');
|
|
42
|
-
for (var i = 0; i < requestedParts.length; i++) {
|
|
43
|
-
if (requestedParts[i] !== detectedParts[i]) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { globalScope } from '../util/global-scope';
|
|
7
|
-
export function supportsPerformanceObserver() {
|
|
8
|
-
return typeof globalScope?.PerformanceObserver === 'function';
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"framework-detection.d.ts","sourceRoot":"","sources":["../../../../src/common/metrics/framework-detection.js"],"names":[],"mappings":"AAcA,0CAkBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-agent.d.ts","sourceRoot":"","sources":["../../../../src/common/util/user-agent.js"],"names":[],"mappings":"AA2BA,wDA4BC;AA7CD,2BAAoB;AACpB,8BAAuB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"supports-performance-observer.d.ts","sourceRoot":"","sources":["../../../../src/common/window/supports-performance-observer.js"],"names":[],"mappings":"AAOA,uDAEC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lazy-loader.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/lazy-loader.js"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,gEAFa,QAAQ,+BAA2B,IAAI,CAAC,CAyBpD"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { isBrowserScope } from '../util/global-scope'
|
|
2
|
-
|
|
3
|
-
var FRAMEWORKS = {
|
|
4
|
-
REACT: 'React',
|
|
5
|
-
ANGULAR: 'Angular',
|
|
6
|
-
ANGULARJS: 'AngularJS',
|
|
7
|
-
BACKBONE: 'Backbone',
|
|
8
|
-
EMBER: 'Ember',
|
|
9
|
-
VUE: 'Vue',
|
|
10
|
-
METEOR: 'Meteor',
|
|
11
|
-
ZEPTO: 'Zepto',
|
|
12
|
-
JQUERY: 'Jquery'
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function getFrameworks () {
|
|
16
|
-
if (!isBrowserScope) return [] // don't bother detecting frameworks if not in the main window context
|
|
17
|
-
|
|
18
|
-
var frameworks = []
|
|
19
|
-
try {
|
|
20
|
-
if (detectReact()) frameworks.push(FRAMEWORKS.REACT)
|
|
21
|
-
if (detectAngularJs()) frameworks.push(FRAMEWORKS.ANGULARJS)
|
|
22
|
-
if (detectAngular()) frameworks.push(FRAMEWORKS.ANGULAR)
|
|
23
|
-
if (window.Backbone) frameworks.push(FRAMEWORKS.BACKBONE)
|
|
24
|
-
if (window.Ember) frameworks.push(FRAMEWORKS.EMBER)
|
|
25
|
-
if (window.Vue) frameworks.push(FRAMEWORKS.VUE)
|
|
26
|
-
if (window.Meteor) frameworks.push(FRAMEWORKS.METEOR)
|
|
27
|
-
if (window.Zepto) frameworks.push(FRAMEWORKS.ZEPTO)
|
|
28
|
-
if (window.jQuery) frameworks.push(FRAMEWORKS.JQUERY)
|
|
29
|
-
} catch (err) {
|
|
30
|
-
// not supported?
|
|
31
|
-
}
|
|
32
|
-
return frameworks
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function detectReact () {
|
|
36
|
-
try {
|
|
37
|
-
if (!!window.React || !!window.ReactDOM || !!window.ReactRedux) return true
|
|
38
|
-
if (document.querySelector('[data-reactroot], [data-reactid]')) return true
|
|
39
|
-
var divs = document.querySelectorAll('body > div')
|
|
40
|
-
for (var i = 0; i < divs.length; i++) {
|
|
41
|
-
if (Object.keys(divs[i]).indexOf('_reactRootContainer') >= 0) return true
|
|
42
|
-
}
|
|
43
|
-
return false
|
|
44
|
-
} catch (err) {
|
|
45
|
-
// not supported?
|
|
46
|
-
return false
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function detectAngularJs () {
|
|
51
|
-
try {
|
|
52
|
-
if (window.angular) return true
|
|
53
|
-
if (document.querySelector('.ng-binding, [ng-app], [data-ng-app], [ng-controller], [data-ng-controller], [ng-repeat], [data-ng-repeat]')) return true
|
|
54
|
-
if (document.querySelector('script[src*="angular.js"], script[src*="angular.min.js"]')) return true
|
|
55
|
-
return false
|
|
56
|
-
} catch (err) {
|
|
57
|
-
// not supported?
|
|
58
|
-
return false
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function detectAngular () {
|
|
63
|
-
try {
|
|
64
|
-
// eslint-disable-next-line
|
|
65
|
-
if (window.hasOwnProperty('ng') && window.ng.hasOwnProperty('coreTokens') && window.ng.coreTokens.hasOwnProperty('NgZone')) return true
|
|
66
|
-
return !!document.querySelectorAll('[ng-version]').length
|
|
67
|
-
} catch (err) {
|
|
68
|
-
// not supported?
|
|
69
|
-
return false
|
|
70
|
-
}
|
|
71
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// Feature-detection is much preferred over using User Agent to detect browser.
|
|
7
|
-
// However, there are cases where feature detection is not possible, for example
|
|
8
|
-
// when a specific version of a browser has a bug that requires a workaround in just
|
|
9
|
-
// that version.
|
|
10
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Browser_Name
|
|
11
|
-
var agentName = null
|
|
12
|
-
var agentVersion = null
|
|
13
|
-
const safari = /Version\/(\S+)\s+Safari/
|
|
14
|
-
|
|
15
|
-
if (navigator.userAgent) {
|
|
16
|
-
var userAgent = navigator.userAgent
|
|
17
|
-
var parts = userAgent.match(safari)
|
|
18
|
-
|
|
19
|
-
if (parts && userAgent.indexOf('Chrome') === -1 &&
|
|
20
|
-
userAgent.indexOf('Chromium') === -1) {
|
|
21
|
-
agentName = 'Safari'
|
|
22
|
-
agentVersion = parts[1]
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { agentName as agent, agentVersion as version }
|
|
27
|
-
|
|
28
|
-
export function match (name, version) {
|
|
29
|
-
if (!agentName) {
|
|
30
|
-
return false
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (name !== agentName) {
|
|
34
|
-
return false
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// version not provided, only match by name
|
|
38
|
-
if (!version) {
|
|
39
|
-
return true
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// version provided, but not detected - not reliable match
|
|
43
|
-
if (!agentVersion) {
|
|
44
|
-
return false
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
var detectedParts = agentVersion.split('.')
|
|
48
|
-
var requestedParts = version.split('.')
|
|
49
|
-
for (var i = 0; i < requestedParts.length; i++) {
|
|
50
|
-
if (requestedParts[i] !== detectedParts[i]) {
|
|
51
|
-
return false
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return true
|
|
56
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { globalScope } from '../util/global-scope'
|
|
7
|
-
|
|
8
|
-
export function supportsPerformanceObserver () {
|
|
9
|
-
return (typeof globalScope?.PerformanceObserver === 'function')
|
|
10
|
-
}
|
|
File without changes
|