@newrelic/browser-agent 1.262.0 → 1.264.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/CHANGELOG.md +21 -0
- package/README.md +2 -2
- package/dist/cjs/cdn/experimental.js +3 -7
- package/dist/cjs/cdn/pro.js +2 -2
- package/dist/cjs/cdn/spa.js +2 -2
- package/dist/cjs/common/aggregate/aggregator.js +3 -3
- package/dist/cjs/common/config/state/configurable.js +4 -4
- package/dist/cjs/common/config/state/init.js +11 -6
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/constants/runtime.js +1 -3
- package/dist/cjs/common/context/shared-context.js +2 -2
- package/dist/cjs/common/drain/drain.js +5 -5
- package/dist/cjs/common/harvest/harvest.js +3 -3
- package/dist/cjs/common/serialize/bel-serializer.js +2 -2
- package/dist/cjs/common/session/session-entity.js +3 -3
- package/dist/cjs/common/timing/time-keeper.js +13 -2
- package/dist/cjs/common/url/encode.js +3 -5
- package/dist/cjs/common/util/console.js +3 -4
- package/dist/cjs/common/util/obfuscate.js +3 -3
- package/dist/cjs/common/util/submit-data.js +0 -1
- package/dist/cjs/common/vitals/vital-metric.js +1 -1
- package/dist/cjs/common/wrap/wrap-logger.js +1 -2
- package/dist/cjs/common/wrap/wrap-xhr.js +1 -1
- package/dist/cjs/features/ajax/aggregate/index.js +1 -1
- package/dist/cjs/features/ajax/instrument/index.js +1 -1
- package/dist/cjs/features/generic_events/aggregate/index.js +137 -0
- package/dist/cjs/features/generic_events/constants.js +8 -0
- package/dist/cjs/features/generic_events/index.js +12 -0
- package/dist/cjs/features/generic_events/instrument/index.js +27 -0
- package/dist/cjs/features/jserrors/aggregate/index.js +13 -12
- package/dist/cjs/features/jserrors/instrument/index.js +1 -1
- package/dist/cjs/features/logging/aggregate/index.js +6 -6
- package/dist/cjs/features/logging/constants.js +2 -5
- package/dist/cjs/features/logging/instrument/index.js +1 -1
- package/dist/cjs/features/metrics/aggregate/index.js +17 -1
- package/dist/cjs/features/metrics/instrument/index.js +1 -1
- package/dist/cjs/features/page_action/instrument/index.js +6 -6
- package/dist/cjs/features/page_view_event/aggregate/index.js +21 -5
- package/dist/cjs/features/page_view_event/aggregate/initialized-features.js +1 -1
- package/dist/cjs/features/page_view_event/instrument/index.js +1 -1
- package/dist/cjs/features/page_view_timing/aggregate/index.js +3 -3
- package/dist/cjs/features/page_view_timing/instrument/index.js +1 -1
- package/dist/cjs/features/session_replay/aggregate/index.js +3 -3
- package/dist/cjs/features/session_replay/instrument/index.js +1 -1
- package/dist/cjs/features/session_replay/shared/recorder.js +1 -1
- package/dist/cjs/features/session_replay/shared/stylesheet-evaluator.js +1 -1
- package/dist/cjs/features/session_trace/aggregate/index.js +1 -1
- package/dist/cjs/features/session_trace/aggregate/trace/storage.js +2 -2
- package/dist/cjs/features/session_trace/instrument/index.js +1 -1
- package/dist/cjs/features/soft_navigations/aggregate/bel-node.js +1 -1
- package/dist/cjs/features/soft_navigations/aggregate/index.js +1 -1
- package/dist/cjs/features/soft_navigations/aggregate/interaction.js +5 -5
- package/dist/cjs/features/soft_navigations/instrument/index.js +1 -1
- package/dist/cjs/features/spa/aggregate/index.js +3 -4
- package/dist/cjs/features/spa/aggregate/interaction.js +2 -2
- package/dist/cjs/features/spa/aggregate/serializer.js +1 -2
- package/dist/cjs/features/spa/instrument/index.js +1 -1
- package/dist/cjs/features/utils/aggregate-base.js +6 -3
- package/dist/cjs/features/utils/instrument-base.js +2 -2
- package/dist/cjs/features/utils/lazy-feature-loader.js +2 -2
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/loaders/agent-base.js +1 -5
- package/dist/cjs/loaders/agent.js +3 -4
- package/dist/cjs/loaders/api/api.js +10 -8
- package/dist/cjs/loaders/api/apiAsync.js +1 -1
- package/dist/cjs/loaders/browser-agent.js +4 -3
- package/dist/cjs/loaders/configure/configure.js +4 -3
- package/dist/cjs/loaders/features/features.js +8 -4
- package/dist/cjs/loaders/micro-agent.js +6 -6
- package/dist/esm/cdn/experimental.js +2 -5
- package/dist/esm/cdn/pro.js +2 -2
- package/dist/esm/cdn/spa.js +2 -2
- package/dist/esm/common/aggregate/aggregator.js +3 -3
- package/dist/esm/common/config/state/configurable.js +4 -4
- package/dist/esm/common/config/state/init.js +11 -6
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/constants/runtime.js +0 -2
- package/dist/esm/common/context/shared-context.js +2 -2
- package/dist/esm/common/drain/drain.js +5 -5
- package/dist/esm/common/harvest/harvest.js +4 -4
- package/dist/esm/common/serialize/bel-serializer.js +2 -2
- package/dist/esm/common/session/session-entity.js +4 -4
- package/dist/esm/common/timing/time-keeper.js +12 -2
- package/dist/esm/common/url/encode.js +3 -5
- package/dist/esm/common/util/console.js +3 -4
- package/dist/esm/common/util/obfuscate.js +3 -3
- package/dist/esm/common/util/submit-data.js +0 -1
- package/dist/esm/common/vitals/vital-metric.js +1 -1
- package/dist/esm/common/wrap/wrap-logger.js +1 -2
- package/dist/esm/common/wrap/wrap-xhr.js +1 -1
- package/dist/esm/features/ajax/aggregate/index.js +1 -1
- package/dist/esm/features/ajax/instrument/index.js +1 -1
- package/dist/esm/features/generic_events/aggregate/index.js +129 -0
- package/dist/esm/features/generic_events/constants.js +2 -0
- package/dist/esm/features/generic_events/index.js +1 -0
- package/dist/esm/features/generic_events/instrument/index.js +20 -0
- package/dist/esm/features/jserrors/aggregate/index.js +13 -12
- package/dist/esm/features/jserrors/instrument/index.js +1 -1
- package/dist/esm/features/logging/aggregate/index.js +7 -7
- package/dist/esm/features/logging/constants.js +1 -4
- package/dist/esm/features/logging/instrument/index.js +1 -1
- package/dist/esm/features/metrics/aggregate/index.js +17 -1
- package/dist/esm/features/metrics/instrument/index.js +1 -1
- package/dist/esm/features/page_action/instrument/index.js +7 -6
- package/dist/esm/features/page_view_event/aggregate/index.js +22 -6
- package/dist/esm/features/page_view_event/aggregate/initialized-features.js +1 -1
- package/dist/esm/features/page_view_event/instrument/index.js +1 -1
- package/dist/esm/features/page_view_timing/aggregate/index.js +3 -3
- package/dist/esm/features/page_view_timing/instrument/index.js +1 -1
- package/dist/esm/features/session_replay/aggregate/index.js +3 -3
- package/dist/esm/features/session_replay/instrument/index.js +1 -1
- package/dist/esm/features/session_replay/shared/recorder.js +1 -1
- package/dist/esm/features/session_replay/shared/stylesheet-evaluator.js +1 -1
- package/dist/esm/features/session_trace/aggregate/index.js +1 -1
- package/dist/esm/features/session_trace/aggregate/trace/storage.js +2 -2
- package/dist/esm/features/session_trace/instrument/index.js +1 -1
- package/dist/esm/features/soft_navigations/aggregate/bel-node.js +1 -1
- package/dist/esm/features/soft_navigations/aggregate/index.js +1 -1
- package/dist/esm/features/soft_navigations/aggregate/interaction.js +5 -5
- package/dist/esm/features/soft_navigations/instrument/index.js +1 -1
- package/dist/esm/features/spa/aggregate/index.js +3 -4
- package/dist/esm/features/spa/aggregate/interaction.js +2 -2
- package/dist/esm/features/spa/aggregate/serializer.js +1 -2
- package/dist/esm/features/spa/instrument/index.js +1 -1
- package/dist/esm/features/utils/aggregate-base.js +7 -4
- package/dist/esm/features/utils/instrument-base.js +2 -2
- package/dist/esm/features/utils/lazy-feature-loader.js +2 -2
- package/dist/esm/index.js +3 -0
- package/dist/esm/loaders/agent-base.js +1 -5
- package/dist/esm/loaders/agent.js +3 -4
- package/dist/esm/loaders/api/api.js +10 -8
- package/dist/esm/loaders/api/apiAsync.js +1 -1
- package/dist/esm/loaders/browser-agent.js +3 -2
- package/dist/esm/loaders/configure/configure.js +4 -3
- package/dist/esm/loaders/features/features.js +8 -4
- package/dist/esm/loaders/micro-agent.js +6 -6
- package/dist/types/common/aggregate/aggregator.d.ts.map +1 -1
- package/dist/types/common/config/state/init.d.ts.map +1 -1
- package/dist/types/common/constants/runtime.d.ts +0 -1
- package/dist/types/common/constants/runtime.d.ts.map +1 -1
- package/dist/types/common/drain/drain.d.ts.map +1 -1
- package/dist/types/common/serialize/bel-serializer.d.ts.map +1 -1
- package/dist/types/common/timing/time-keeper.d.ts +2 -1
- package/dist/types/common/timing/time-keeper.d.ts.map +1 -1
- package/dist/types/common/url/encode.d.ts.map +1 -1
- package/dist/types/common/util/console.d.ts +1 -1
- package/dist/types/common/util/console.d.ts.map +1 -1
- package/dist/types/common/util/submit-data.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-logger.d.ts.map +1 -1
- package/dist/types/features/{page_action → generic_events}/aggregate/index.d.ts +7 -5
- package/dist/types/features/generic_events/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/generic_events/constants.d.ts +2 -0
- package/dist/types/features/generic_events/constants.d.ts.map +1 -0
- package/dist/types/features/generic_events/index.d.ts +2 -0
- package/dist/types/features/generic_events/index.d.ts.map +1 -0
- package/dist/types/features/generic_events/instrument/index.d.ts +6 -0
- package/dist/types/features/generic_events/instrument/index.d.ts.map +1 -0
- package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/logging/constants.d.ts +0 -3
- package/dist/types/features/logging/constants.d.ts.map +1 -1
- package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_action/instrument/index.d.ts +5 -4
- package/dist/types/features/page_action/instrument/index.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/features/session_replay/shared/recorder.d.ts.map +1 -1
- package/dist/types/features/spa/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/spa/aggregate/interaction.d.ts.map +1 -1
- package/dist/types/features/spa/aggregate/serializer.d.ts.map +1 -1
- package/dist/types/features/utils/aggregate-base.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/loaders/agent-base.d.ts +0 -1
- package/dist/types/loaders/agent-base.d.ts.map +1 -1
- package/dist/types/loaders/agent.d.ts.map +1 -1
- package/dist/types/loaders/api/api.d.ts.map +1 -1
- package/dist/types/loaders/browser-agent.d.ts.map +1 -1
- package/dist/types/loaders/configure/configure.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 +25 -6
- package/src/cdn/experimental.js +2 -4
- package/src/cdn/pro.js +2 -2
- package/src/cdn/spa.js +2 -2
- package/src/common/aggregate/aggregator.js +2 -3
- package/src/common/config/state/configurable.js +4 -4
- package/src/common/config/state/init.js +6 -4
- package/src/common/constants/runtime.js +0 -2
- package/src/common/context/shared-context.js +2 -2
- package/src/common/drain/drain.js +4 -5
- package/src/common/harvest/harvest.js +4 -4
- package/src/common/serialize/bel-serializer.js +1 -2
- package/src/common/session/session-entity.js +4 -4
- package/src/common/timing/time-keeper.js +14 -2
- package/src/common/url/encode.js +2 -3
- package/src/common/util/console.js +3 -4
- package/src/common/util/obfuscate.js +3 -3
- package/src/common/util/submit-data.js +0 -1
- package/src/common/wrap/wrap-logger.js +1 -2
- package/src/common/wrap/wrap-xhr.js +1 -1
- package/src/features/generic_events/aggregate/index.js +133 -0
- package/src/features/generic_events/constants.js +3 -0
- package/src/features/generic_events/index.js +1 -0
- package/src/features/generic_events/instrument/index.js +22 -0
- package/src/features/jserrors/aggregate/index.js +4 -5
- package/src/features/logging/aggregate/index.js +6 -6
- package/src/features/logging/constants.js +0 -4
- package/src/features/metrics/aggregate/index.js +12 -0
- package/src/features/page_action/instrument/index.js +6 -6
- package/src/features/page_view_event/aggregate/index.js +22 -5
- package/src/features/page_view_event/aggregate/initialized-features.js +1 -1
- package/src/features/page_view_timing/aggregate/index.js +1 -2
- package/src/features/session_replay/aggregate/index.js +1 -1
- package/src/features/session_replay/shared/recorder.js +1 -1
- package/src/features/spa/aggregate/index.js +2 -3
- package/src/features/spa/aggregate/interaction.js +1 -2
- package/src/features/spa/aggregate/serializer.js +1 -2
- package/src/features/utils/aggregate-base.js +7 -4
- package/src/features/utils/instrument-base.js +2 -2
- package/src/features/utils/lazy-feature-loader.js +2 -2
- package/src/index.js +3 -0
- package/src/loaders/agent-base.js +1 -5
- package/src/loaders/agent.js +3 -4
- package/src/loaders/api/api.js +10 -8
- package/src/loaders/api/apiAsync.js +1 -1
- package/src/loaders/browser-agent.js +5 -3
- package/src/loaders/configure/configure.js +5 -1
- package/src/loaders/features/features.js +8 -4
- package/src/loaders/micro-agent.js +6 -6
- package/dist/cjs/cdn/polyfills/lite.js +0 -16
- package/dist/cjs/cdn/polyfills/pro.js +0 -21
- package/dist/cjs/cdn/polyfills/spa.js +0 -22
- package/dist/cjs/cdn/polyfills.js +0 -24
- package/dist/cjs/common/util/map-own.js +0 -31
- package/dist/cjs/features/page_action/aggregate/index.js +0 -121
- package/dist/esm/cdn/polyfills/lite.js +0 -14
- package/dist/esm/cdn/polyfills/pro.js +0 -19
- package/dist/esm/cdn/polyfills/spa.js +0 -20
- package/dist/esm/cdn/polyfills.js +0 -27
- package/dist/esm/common/util/map-own.js +0 -24
- package/dist/esm/features/page_action/aggregate/index.js +0 -114
- package/dist/types/cdn/polyfills/lite.d.ts +0 -2
- package/dist/types/cdn/polyfills/lite.d.ts.map +0 -1
- package/dist/types/cdn/polyfills/pro.d.ts +0 -2
- package/dist/types/cdn/polyfills/pro.d.ts.map +0 -1
- package/dist/types/cdn/polyfills/spa.d.ts +0 -2
- package/dist/types/cdn/polyfills/spa.d.ts.map +0 -1
- package/dist/types/cdn/polyfills.d.ts +0 -2
- package/dist/types/cdn/polyfills.d.ts.map +0 -1
- package/dist/types/common/util/map-own.d.ts +0 -3
- package/dist/types/common/util/map-own.d.ts.map +0 -1
- package/dist/types/features/page_action/aggregate/index.d.ts.map +0 -1
- package/src/cdn/polyfills/lite.js +0 -20
- package/src/cdn/polyfills/pro.js +0 -30
- package/src/cdn/polyfills/spa.js +0 -32
- package/src/cdn/polyfills.js +0 -27
- package/src/common/util/map-own.js +0 -22
- package/src/features/page_action/aggregate/index.js +0 -114
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.264.0](https://github.com/newrelic/newrelic-browser-agent/compare/v1.263.0...v1.264.0) (2024-08-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Create generic events feature with 1,000 event limit ([#1121](https://github.com/newrelic/newrelic-browser-agent/issues/1121)) ([63ab04f](https://github.com/newrelic/newrelic-browser-agent/commit/63ab04fa9b2a0c347e175c9174f563e73767933b))
|
|
12
|
+
* Report Page Actions with Generic Events Feature ([#1124](https://github.com/newrelic/newrelic-browser-agent/issues/1124)) ([0d52acf](https://github.com/newrelic/newrelic-browser-agent/commit/0d52acf9eaa9a2c170459f03e9edad25375f4c1c))
|
|
13
|
+
|
|
14
|
+
## [1.263.0](https://github.com/newrelic/newrelic-browser-agent/compare/v1.262.0...v1.263.0) (2024-07-25)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* Optimize bundle size with warning codes ([#1111](https://github.com/newrelic/newrelic-browser-agent/issues/1111)) ([6ab7d2b](https://github.com/newrelic/newrelic-browser-agent/commit/6ab7d2bee5053fc75c0d20c6257afea5cf16d76d))
|
|
20
|
+
* Shut down agent if improperly configured ([#1116](https://github.com/newrelic/newrelic-browser-agent/issues/1116)) ([edc20d4](https://github.com/newrelic/newrelic-browser-agent/commit/edc20d4f81d1c0662f3f244240cc968b1f3870c9))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* Prevent agent using invalid date header ([#1122](https://github.com/newrelic/newrelic-browser-agent/issues/1122)) ([6851c1b](https://github.com/newrelic/newrelic-browser-agent/commit/6851c1b1733c513ab4de119e875593a418e51b93))
|
|
26
|
+
|
|
6
27
|
## [1.262.0](https://github.com/newrelic/newrelic-browser-agent/compare/v1.261.2...v1.262.0) (2024-07-09)
|
|
7
28
|
|
|
8
29
|
|
package/README.md
CHANGED
|
@@ -78,9 +78,9 @@ const options = {
|
|
|
78
78
|
The following features may be disabled by adding `init` entries as shown above. Note that the `page_view_event` feature may not be disabled.
|
|
79
79
|
|
|
80
80
|
- `ajax`
|
|
81
|
+
- `generic_events`
|
|
81
82
|
- `jserrors`
|
|
82
83
|
- `metrics`
|
|
83
|
-
- `page_action`
|
|
84
84
|
- `page_view_timing`
|
|
85
85
|
- `session_replay`
|
|
86
86
|
- `session_trace`
|
|
@@ -125,7 +125,7 @@ The following feature modules are available for inclusion in the `features` arra
|
|
|
125
125
|
import { Ajax } from '@newrelic/browser-agent/features/ajax';
|
|
126
126
|
import { JSErrors } from '@newrelic/browser-agent/features/jserrors';
|
|
127
127
|
import { Metrics } from '@newrelic/browser-agent/features/metrics';
|
|
128
|
-
import {
|
|
128
|
+
import { GenericEvents } from '@newrelic/browser-agent/features/generic_events';
|
|
129
129
|
import { PageViewEvent } from '@newrelic/browser-agent/features/page_view_event';
|
|
130
130
|
import { PageViewTiming } from '@newrelic/browser-agent/features/page_view_timing';
|
|
131
131
|
import { SessionTrace } from '@newrelic/browser-agent/features/session_trace';
|
|
@@ -8,8 +8,8 @@ var _instrument4 = require("../features/jserrors/instrument");
|
|
|
8
8
|
var _instrument5 = require("../features/ajax/instrument");
|
|
9
9
|
var _instrument6 = require("../features/session_trace/instrument");
|
|
10
10
|
var _instrument7 = require("../features/session_replay/instrument");
|
|
11
|
-
var _instrument8 = require("../features/
|
|
12
|
-
var _instrument9 = require("../features/
|
|
11
|
+
var _instrument8 = require("../features/generic_events/instrument");
|
|
12
|
+
var _instrument9 = require("../features/soft_navigations/instrument");
|
|
13
13
|
var _instrument10 = require("../features/logging/instrument");
|
|
14
14
|
/*
|
|
15
15
|
* Copyright 2023 New Relic Corporation. All rights reserved.
|
|
@@ -22,11 +22,7 @@ var _instrument10 = require("../features/logging/instrument");
|
|
|
22
22
|
* It is not production ready, and is not intended to be imported or implemented in any build of the browser agent
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
// import { Instrument as InstrumentSpa } from '../features/spa/instrument'
|
|
26
|
-
|
|
27
25
|
new _agent.Agent({
|
|
28
|
-
features: [_instrument5.Instrument, _instrument.Instrument, _instrument2.Instrument, _instrument6.Instrument, _instrument7.Instrument, _instrument3.Instrument,
|
|
29
|
-
// InstrumentSpa,
|
|
30
|
-
_instrument8.Instrument],
|
|
26
|
+
features: [_instrument5.Instrument, _instrument.Instrument, _instrument2.Instrument, _instrument6.Instrument, _instrument7.Instrument, _instrument3.Instrument, _instrument4.Instrument, _instrument8.Instrument, _instrument10.Instrument, _instrument9.Instrument],
|
|
31
27
|
loaderType: 'experimental'
|
|
32
28
|
});
|
package/dist/cjs/cdn/pro.js
CHANGED
|
@@ -8,7 +8,7 @@ var _instrument4 = require("../features/jserrors/instrument");
|
|
|
8
8
|
var _instrument5 = require("../features/ajax/instrument");
|
|
9
9
|
var _instrument6 = require("../features/session_trace/instrument");
|
|
10
10
|
var _instrument7 = require("../features/session_replay/instrument");
|
|
11
|
-
var _instrument8 = require("../features/
|
|
11
|
+
var _instrument8 = require("../features/generic_events/instrument");
|
|
12
12
|
var _instrument9 = require("../features/logging/instrument");
|
|
13
13
|
/**
|
|
14
14
|
* @file Creates a "Pro" agent loader bundle composed of the core Agent and all available feature modules except `spa`.
|
|
@@ -16,6 +16,6 @@ var _instrument9 = require("../features/logging/instrument");
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
new _agent.Agent({
|
|
19
|
-
features: [_instrument.Instrument, _instrument2.Instrument, _instrument6.Instrument, _instrument7.Instrument, _instrument5.Instrument, _instrument3.Instrument,
|
|
19
|
+
features: [_instrument.Instrument, _instrument2.Instrument, _instrument6.Instrument, _instrument7.Instrument, _instrument5.Instrument, _instrument3.Instrument, _instrument4.Instrument, _instrument8.Instrument, _instrument9.Instrument],
|
|
20
20
|
loaderType: 'pro'
|
|
21
21
|
});
|
package/dist/cjs/cdn/spa.js
CHANGED
|
@@ -10,14 +10,14 @@ var _instrument6 = require("../features/session_trace/instrument");
|
|
|
10
10
|
var _instrument7 = require("../features/session_replay/instrument");
|
|
11
11
|
var _instrument8 = require("../features/soft_navigations/instrument");
|
|
12
12
|
var _instrument9 = require("../features/spa/instrument");
|
|
13
|
-
var _instrument10 = require("../features/
|
|
13
|
+
var _instrument10 = require("../features/generic_events/instrument");
|
|
14
14
|
var _instrument11 = require("../features/logging/instrument");
|
|
15
15
|
/**
|
|
16
16
|
* @file Creates a "SPA" agent loader bundle composed of the core agent and all available feature modules.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
new _agent.Agent({
|
|
20
|
-
features: [_instrument5.Instrument, _instrument.Instrument, _instrument2.Instrument, _instrument6.Instrument, _instrument7.Instrument, _instrument3.Instrument,
|
|
20
|
+
features: [_instrument5.Instrument, _instrument.Instrument, _instrument2.Instrument, _instrument6.Instrument, _instrument7.Instrument, _instrument3.Instrument, _instrument4.Instrument, _instrument10.Instrument, _instrument11.Instrument, _instrument8.Instrument, _instrument9.Instrument // either the softnav or the old spa will be used (not both), but we still need to pack both to avoid dynamic import for instrument files
|
|
21
21
|
],
|
|
22
22
|
loaderType: 'spa'
|
|
23
23
|
});
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Aggregator = void 0;
|
|
7
7
|
var _sharedContext = require("../context/shared-context");
|
|
8
|
-
var _mapOwn = require("../util/map-own");
|
|
9
8
|
/*
|
|
10
9
|
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
11
10
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -36,7 +35,7 @@ class Aggregator extends _sharedContext.SharedContext {
|
|
|
36
35
|
oldMetrics.count += metrics.count;
|
|
37
36
|
|
|
38
37
|
// iterate through each new metric and merge
|
|
39
|
-
|
|
38
|
+
Object.keys(metrics || {}).forEach(key => {
|
|
40
39
|
// count is a special case handled above
|
|
41
40
|
if (key === 'count') return;
|
|
42
41
|
var oldMetric = oldMetrics[key];
|
|
@@ -96,7 +95,8 @@ function aggregateMetrics(newMetrics, oldMetrics) {
|
|
|
96
95
|
count: 0
|
|
97
96
|
};
|
|
98
97
|
oldMetrics.count += 1;
|
|
99
|
-
|
|
98
|
+
Object.entries(newMetrics || {}).forEach(_ref => {
|
|
99
|
+
let [key, value] = _ref;
|
|
100
100
|
oldMetrics[key] = updateMetric(value, oldMetrics[key]);
|
|
101
101
|
});
|
|
102
102
|
return oldMetrics;
|
|
@@ -7,8 +7,8 @@ exports.getModeledObject = getModeledObject;
|
|
|
7
7
|
var _console = require("../../util/console");
|
|
8
8
|
function getModeledObject(obj, model) {
|
|
9
9
|
try {
|
|
10
|
-
if (!obj || typeof obj !== 'object') return (0, _console.warn)(
|
|
11
|
-
if (!model || typeof model !== 'object') return (0, _console.warn)(
|
|
10
|
+
if (!obj || typeof obj !== 'object') return (0, _console.warn)(3);
|
|
11
|
+
if (!model || typeof model !== 'object') return (0, _console.warn)(4);
|
|
12
12
|
// allow getters and setters to pass from model to target
|
|
13
13
|
const output = Object.create(Object.getPrototypeOf(model), Object.getOwnPropertyDescriptors(model));
|
|
14
14
|
const target = Object.keys(output).length === 0 ? obj : output;
|
|
@@ -21,11 +21,11 @@ function getModeledObject(obj, model) {
|
|
|
21
21
|
}
|
|
22
22
|
if (Array.isArray(obj[key]) && Array.isArray(model[key])) output[key] = Array.from(new Set([...obj[key], ...model[key]]));else if (typeof obj[key] === 'object' && typeof model[key] === 'object') output[key] = getModeledObject(obj[key], model[key]);else output[key] = obj[key];
|
|
23
23
|
} catch (e) {
|
|
24
|
-
(0, _console.warn)(
|
|
24
|
+
(0, _console.warn)(1, e);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
return output;
|
|
28
28
|
} catch (err) {
|
|
29
|
-
(0, _console.warn)(
|
|
29
|
+
(0, _console.warn)(2, err);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -53,6 +53,11 @@ const model = () => {
|
|
|
53
53
|
allowed_origins: undefined
|
|
54
54
|
},
|
|
55
55
|
feature_flags: [],
|
|
56
|
+
generic_events: {
|
|
57
|
+
enabled: true,
|
|
58
|
+
harvestTimeSeconds: 30,
|
|
59
|
+
autoStart: true
|
|
60
|
+
},
|
|
56
61
|
harvest: {
|
|
57
62
|
tooManyRequestsDelay: 60
|
|
58
63
|
},
|
|
@@ -73,9 +78,7 @@ const model = () => {
|
|
|
73
78
|
},
|
|
74
79
|
obfuscate: undefined,
|
|
75
80
|
page_action: {
|
|
76
|
-
enabled: true
|
|
77
|
-
harvestTimeSeconds: 30,
|
|
78
|
-
autoStart: true
|
|
81
|
+
enabled: true
|
|
79
82
|
},
|
|
80
83
|
page_view_event: {
|
|
81
84
|
enabled: true,
|
|
@@ -117,6 +120,8 @@ const model = () => {
|
|
|
117
120
|
// serialize images for collection without public asset url -- right now this is only useful for testing as it easily generates payloads too large to be harvested
|
|
118
121
|
inline_stylesheet: true,
|
|
119
122
|
// serialize css for collection without public asset url
|
|
123
|
+
fix_stylesheets: true,
|
|
124
|
+
// fetch missing stylesheet resources for inlining, only works if 'inline_stylesheet' is also true
|
|
120
125
|
// recording config settings
|
|
121
126
|
mask_all_inputs: true,
|
|
122
127
|
// this has a getter/setter to facilitate validation of the selectors
|
|
@@ -124,7 +129,7 @@ const model = () => {
|
|
|
124
129
|
return hiddenState.mask_selector;
|
|
125
130
|
},
|
|
126
131
|
set mask_text_selector(val) {
|
|
127
|
-
if ((0, _querySelector.isValidSelector)(val)) hiddenState.mask_selector = "".concat(val, ",").concat(nrMask);else if (val === '' || val === null) hiddenState.mask_selector = nrMask;else (0, _console.warn)(
|
|
132
|
+
if ((0, _querySelector.isValidSelector)(val)) hiddenState.mask_selector = "".concat(val, ",").concat(nrMask);else if (val === '' || val === null) hiddenState.mask_selector = nrMask;else (0, _console.warn)(5, val);
|
|
128
133
|
},
|
|
129
134
|
// these properties only have getters because they are enforcable constants and should error if someone tries to override them
|
|
130
135
|
get block_class() {
|
|
@@ -142,7 +147,7 @@ const model = () => {
|
|
|
142
147
|
return hiddenState.block_selector;
|
|
143
148
|
},
|
|
144
149
|
set block_selector(val) {
|
|
145
|
-
if ((0, _querySelector.isValidSelector)(val)) hiddenState.block_selector += ",".concat(val);else if (val !== '') (0, _console.warn)(
|
|
150
|
+
if ((0, _querySelector.isValidSelector)(val)) hiddenState.block_selector += ",".concat(val);else if (val !== '') (0, _console.warn)(6, val);
|
|
146
151
|
},
|
|
147
152
|
// password: must always be present and true no matter what customer sets
|
|
148
153
|
get mask_input_options() {
|
|
@@ -152,7 +157,7 @@ const model = () => {
|
|
|
152
157
|
if (val && typeof val === 'object') hiddenState.mask_input_options = {
|
|
153
158
|
...val,
|
|
154
159
|
password: true
|
|
155
|
-
};else (0, _console.warn)(
|
|
160
|
+
};else (0, _console.warn)(7, val);
|
|
156
161
|
}
|
|
157
162
|
},
|
|
158
163
|
session_trace: {
|
|
@@ -12,7 +12,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.DIST_METHOD = exports.BUILD_EN
|
|
|
12
12
|
/**
|
|
13
13
|
* Exposes the version of the agent
|
|
14
14
|
*/
|
|
15
|
-
const VERSION = exports.VERSION = "1.
|
|
15
|
+
const VERSION = exports.VERSION = "1.264.0";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Exposes the build type of the agent
|
|
@@ -12,7 +12,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.DIST_METHOD = exports.BUILD_EN
|
|
|
12
12
|
/**
|
|
13
13
|
* Exposes the version of the agent
|
|
14
14
|
*/
|
|
15
|
-
const VERSION = exports.VERSION = "1.
|
|
15
|
+
const VERSION = exports.VERSION = "1.264.0";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Exposes the build type of the agent
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.supportsSendBeacon = exports.originTime = exports.loadedAsDeferredBrowserScript = exports.isiOS = exports.isWorkerScope = exports.
|
|
6
|
+
exports.supportsSendBeacon = exports.originTime = exports.loadedAsDeferredBrowserScript = exports.isiOS = exports.isWorkerScope = exports.isBrowserScope = exports.initiallyHidden = exports.initialLocation = exports.iOSBelow16 = exports.globalScope = exports.ffVersion = void 0;
|
|
7
7
|
var _now = require("../timing/now");
|
|
8
8
|
/**
|
|
9
9
|
* @file Contains constants about the environment the agent is running
|
|
@@ -42,8 +42,6 @@ const ffVersion = exports.ffVersion = (() => {
|
|
|
42
42
|
}
|
|
43
43
|
return 0;
|
|
44
44
|
})();
|
|
45
|
-
const isIE = exports.isIE = Boolean(isBrowserScope && window.document.documentMode); // deprecated property that only works in IE
|
|
46
|
-
|
|
47
45
|
const supportsSendBeacon = exports.supportsSendBeacon = !!globalScope.navigator?.sendBeacon;
|
|
48
46
|
|
|
49
47
|
/**
|
|
@@ -12,7 +12,7 @@ const model = {
|
|
|
12
12
|
class SharedContext {
|
|
13
13
|
constructor(context) {
|
|
14
14
|
try {
|
|
15
|
-
if (typeof context !== 'object') return (0, _console.warn)(
|
|
15
|
+
if (typeof context !== 'object') return (0, _console.warn)(8);
|
|
16
16
|
this.sharedContext = {};
|
|
17
17
|
Object.assign(this.sharedContext, model);
|
|
18
18
|
Object.entries(context).forEach(_ref => {
|
|
@@ -20,7 +20,7 @@ class SharedContext {
|
|
|
20
20
|
if (Object.keys(model).includes(key)) this.sharedContext[key] = value;
|
|
21
21
|
});
|
|
22
22
|
} catch (err) {
|
|
23
|
-
(0, _console.warn)(
|
|
23
|
+
(0, _console.warn)(9, err);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -7,7 +7,6 @@ exports.deregisterDrain = deregisterDrain;
|
|
|
7
7
|
exports.drain = drain;
|
|
8
8
|
exports.registerDrain = registerDrain;
|
|
9
9
|
var _contextualEe = require("../event-emitter/contextual-ee");
|
|
10
|
-
var _mapOwn = require("../util/map-own");
|
|
11
10
|
var _registerHandler = require("../event-emitter/register-handler");
|
|
12
11
|
var _features = require("../../loaders/features/features");
|
|
13
12
|
/*
|
|
@@ -107,7 +106,7 @@ function drainGroup(agentIdentifier, group) {
|
|
|
107
106
|
let activateGroup = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
108
107
|
const baseEE = agentIdentifier ? _contextualEe.ee.get(agentIdentifier) : _contextualEe.ee;
|
|
109
108
|
const handlers = _registerHandler.registerHandler.handlers; // other storage in registerHandler
|
|
110
|
-
if (!baseEE.backlog || !handlers) return;
|
|
109
|
+
if (baseEE.aborted || !baseEE.backlog || !handlers) return;
|
|
111
110
|
|
|
112
111
|
// Only activated features being drained should run queued listeners on buffered events. Deactivated features only need to release memory.
|
|
113
112
|
if (activateGroup) {
|
|
@@ -119,8 +118,9 @@ function drainGroup(agentIdentifier, group) {
|
|
|
119
118
|
// eslint-disable-line no-unmodified-loop-condition
|
|
120
119
|
emitEvent(bufferedEventsInGroup[i], groupHandlers);
|
|
121
120
|
}
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
Object.entries(groupHandlers).forEach(_ref3 => {
|
|
122
|
+
let [eventType, handlerRegistrationList] = _ref3;
|
|
123
|
+
Object.values(handlerRegistrationList || {}).forEach(registration => {
|
|
124
124
|
// registration is an array of: [targetEE, eventHandler]
|
|
125
125
|
registration[0].on(eventType, registration[1]);
|
|
126
126
|
});
|
|
@@ -141,7 +141,7 @@ function drainGroup(agentIdentifier, group) {
|
|
|
141
141
|
*/
|
|
142
142
|
function emitEvent(evt, groupHandlers) {
|
|
143
143
|
var type = evt[1];
|
|
144
|
-
|
|
144
|
+
Object.values(groupHandlers[type] || {}).forEach(registration => {
|
|
145
145
|
var sourceEE = evt[0];
|
|
146
146
|
var ee = registration[0];
|
|
147
147
|
if (ee === sourceEE) {
|
|
@@ -156,7 +156,7 @@ class Harvest extends _sharedContext.SharedContext {
|
|
|
156
156
|
body = (0, _stringify.stringify)(body);
|
|
157
157
|
}
|
|
158
158
|
/** Warn --once per endpoint-- if the agent tries to send large payloads */
|
|
159
|
-
if (body.length > 750000 && (warnings[endpoint] = (warnings?.[endpoint] || 0) + 1) === 1) (0, _console.warn)(
|
|
159
|
+
if (body.length > 750000 && (warnings[endpoint] = (warnings?.[endpoint] || 0) + 1) === 1) (0, _console.warn)(28, endpoint);
|
|
160
160
|
}
|
|
161
161
|
if (!body || body.length === 0 || body === '{}' || body === '[]') {
|
|
162
162
|
// If body is null, undefined, or an empty object or array, send an empty string instead
|
|
@@ -171,11 +171,11 @@ class Harvest extends _sharedContext.SharedContext {
|
|
|
171
171
|
/* Since workers don't support sendBeacon right now, they can only use XHR method.
|
|
172
172
|
Because they still do permit synch XHR, the idea is that at final harvest time (worker is closing),
|
|
173
173
|
we just make a BLOCKING request--trivial impact--with the remaining data as a temp fill-in for sendBeacon.
|
|
174
|
-
Following the removal of img-element method
|
|
174
|
+
Following the removal of img-element method. */
|
|
175
175
|
let result = submitMethod({
|
|
176
176
|
url: fullUrl,
|
|
177
177
|
body,
|
|
178
|
-
sync: opts.unload &&
|
|
178
|
+
sync: opts.unload && _runtime.isWorkerScope,
|
|
179
179
|
headers
|
|
180
180
|
});
|
|
181
181
|
if (!opts.unload && cbFinished && submitMethod === submitData.xhr) {
|
|
@@ -7,7 +7,6 @@ exports.addCustomAttributes = addCustomAttributes;
|
|
|
7
7
|
exports.getAddStringContext = getAddStringContext;
|
|
8
8
|
exports.nullable = nullable;
|
|
9
9
|
exports.numeric = numeric;
|
|
10
|
-
var _mapOwn = require("../util/map-own");
|
|
11
10
|
var _stringify = require("../util/stringify");
|
|
12
11
|
var _obfuscate = require("../util/obfuscate");
|
|
13
12
|
/*
|
|
@@ -48,7 +47,8 @@ function getAddStringContext(agentIdentifier) {
|
|
|
48
47
|
}
|
|
49
48
|
function addCustomAttributes(attrs, addString) {
|
|
50
49
|
var attrParts = [];
|
|
51
|
-
|
|
50
|
+
Object.entries(attrs || {}).forEach(_ref => {
|
|
51
|
+
let [key, val] = _ref;
|
|
52
52
|
if (attrParts.length >= MAX_ATTRIBUTES) return;
|
|
53
53
|
var type = 5;
|
|
54
54
|
var serializedValue;
|
|
@@ -64,7 +64,7 @@ class SessionEntity {
|
|
|
64
64
|
* if the event was spawned on the current page or an adjacent page, and the behavior tied
|
|
65
65
|
* to storage events is critical to apply only to cross-tab behavior
|
|
66
66
|
* */
|
|
67
|
-
if (_runtime.isBrowserScope
|
|
67
|
+
if (_runtime.isBrowserScope) {
|
|
68
68
|
(0, _eventListenerOpts.windowAddEventListener)('storage', event => {
|
|
69
69
|
if (event.key === this.lookupKey) {
|
|
70
70
|
const obj = typeof event.newValue === 'string' ? JSON.parse(event.newValue) : event.newValue;
|
|
@@ -195,7 +195,7 @@ class SessionEntity {
|
|
|
195
195
|
}
|
|
196
196
|
return obj;
|
|
197
197
|
} catch (e) {
|
|
198
|
-
(0, _console.warn)(
|
|
198
|
+
(0, _console.warn)(10, e);
|
|
199
199
|
// storage is inaccessible
|
|
200
200
|
return {};
|
|
201
201
|
}
|
|
@@ -221,7 +221,7 @@ class SessionEntity {
|
|
|
221
221
|
return data;
|
|
222
222
|
} catch (e) {
|
|
223
223
|
// storage is inaccessible
|
|
224
|
-
(0, _console.warn)(
|
|
224
|
+
(0, _console.warn)(11, e);
|
|
225
225
|
return null;
|
|
226
226
|
}
|
|
227
227
|
}
|
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.TimeKeeper = void 0;
|
|
7
7
|
var _runtime = require("../constants/runtime");
|
|
8
8
|
var _config = require("../config/config");
|
|
9
|
+
const rfc2616Regex = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), ([0-3][0-9]) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([0-9]{4}) ([01][0-9]|2[0-3])(:[0-5][0-9]){2} GMT$/;
|
|
10
|
+
|
|
9
11
|
/**
|
|
10
12
|
* Class used to adjust the timestamp of harvested data to New Relic server time. This
|
|
11
13
|
* is done by tracking the performance timings of the RUM call and applying a calculation
|
|
@@ -34,7 +36,7 @@ class TimeKeeper {
|
|
|
34
36
|
/**
|
|
35
37
|
* Represents whether the timekeeper is in a state that it can accurately convert
|
|
36
38
|
* timestamps.
|
|
37
|
-
* @type {
|
|
39
|
+
* @type {boolean}
|
|
38
40
|
*/
|
|
39
41
|
#ready = false;
|
|
40
42
|
constructor(agentIdentifier) {
|
|
@@ -47,6 +49,9 @@ class TimeKeeper {
|
|
|
47
49
|
get correctedOriginTime() {
|
|
48
50
|
return this.#correctedOriginTime;
|
|
49
51
|
}
|
|
52
|
+
get localTimeDiff() {
|
|
53
|
+
return this.#localTimeDiff;
|
|
54
|
+
}
|
|
50
55
|
|
|
51
56
|
/**
|
|
52
57
|
* Process a rum request to calculate NR server time.
|
|
@@ -55,12 +60,16 @@ class TimeKeeper {
|
|
|
55
60
|
* @param endTime {number} The end time of the RUM request
|
|
56
61
|
*/
|
|
57
62
|
processRumRequest(rumRequest, startTime, endTime) {
|
|
58
|
-
this.processStoredDiff();
|
|
63
|
+
this.processStoredDiff(); // Check session entity for stored time diff
|
|
59
64
|
if (this.#ready) return; // Server time calculated from session entity
|
|
65
|
+
|
|
60
66
|
const responseDateHeader = rumRequest.getResponseHeader('Date');
|
|
61
67
|
if (!responseDateHeader) {
|
|
62
68
|
throw new Error('Missing date header on rum response.');
|
|
63
69
|
}
|
|
70
|
+
if (!rfc2616Regex.test(responseDateHeader)) {
|
|
71
|
+
throw new Error('Date header invalid format.');
|
|
72
|
+
}
|
|
64
73
|
const medianRumOffset = (endTime - startTime) / 2;
|
|
65
74
|
const serverOffset = startTime + medianRumOffset;
|
|
66
75
|
|
|
@@ -97,6 +106,8 @@ class TimeKeeper {
|
|
|
97
106
|
|
|
98
107
|
/** Process the session entity and use the info to set the main time calculations if present */
|
|
99
108
|
processStoredDiff() {
|
|
109
|
+
if (this.#ready) return; // Time diff has already been calculated
|
|
110
|
+
|
|
100
111
|
const storedServerTimeDiff = this.#session?.read()?.serverTimeDiff;
|
|
101
112
|
if (typeof storedServerTimeDiff === 'number' && !isNaN(storedServerTimeDiff)) {
|
|
102
113
|
this.#localTimeDiff = storedServerTimeDiff;
|
|
@@ -7,7 +7,6 @@ exports.fromArray = fromArray;
|
|
|
7
7
|
exports.obj = obj;
|
|
8
8
|
exports.param = param;
|
|
9
9
|
exports.qs = qs;
|
|
10
|
-
var _mapOwn = require("../util/map-own");
|
|
11
10
|
var _stringify = require("../util/stringify");
|
|
12
11
|
/*
|
|
13
12
|
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
@@ -23,9 +22,7 @@ var charMap = {
|
|
|
23
22
|
'%24': '$',
|
|
24
23
|
'%3B': ';'
|
|
25
24
|
};
|
|
26
|
-
var charList =
|
|
27
|
-
return k;
|
|
28
|
-
});
|
|
25
|
+
var charList = Object.keys(charMap);
|
|
29
26
|
var safeEncoded = new RegExp(charList.join('|'), 'g');
|
|
30
27
|
function real(c) {
|
|
31
28
|
return charMap[c];
|
|
@@ -48,7 +45,8 @@ function fromArray(qs, maxBytes) {
|
|
|
48
45
|
function obj(payload, maxBytes) {
|
|
49
46
|
var total = 0;
|
|
50
47
|
var result = '';
|
|
51
|
-
|
|
48
|
+
Object.entries(payload || {}).forEach(_ref => {
|
|
49
|
+
let [feature, dataArray] = _ref;
|
|
52
50
|
var intermediate = [];
|
|
53
51
|
var next;
|
|
54
52
|
var i;
|
|
@@ -10,8 +10,7 @@ exports.warn = warn;
|
|
|
10
10
|
* @param {*} [secondary] Secondary data to include, usually an error or object
|
|
11
11
|
* @returns
|
|
12
12
|
*/
|
|
13
|
-
function warn(
|
|
14
|
-
if (typeof console.
|
|
15
|
-
console.
|
|
16
|
-
if (secondary) console.warn(secondary);
|
|
13
|
+
function warn(code, secondary) {
|
|
14
|
+
if (typeof console.debug !== 'function') return;
|
|
15
|
+
console.debug("New Relic Warning: https://github.com/newrelic/newrelic-browser-agent/blob/main/docs/warning-codes.md#".concat(code), secondary);
|
|
17
16
|
}
|
|
@@ -54,15 +54,15 @@ function validateRules(rules) {
|
|
|
54
54
|
var invalidRegexDetected = false;
|
|
55
55
|
for (var i = 0; i < rules.length; i++) {
|
|
56
56
|
if (!('regex' in rules[i])) {
|
|
57
|
-
(0, _console.warn)(
|
|
57
|
+
(0, _console.warn)(12);
|
|
58
58
|
invalidRegexDetected = true;
|
|
59
59
|
} else if (typeof rules[i].regex !== 'string' && !(rules[i].regex instanceof RegExp)) {
|
|
60
|
-
(0, _console.warn)(
|
|
60
|
+
(0, _console.warn)(13);
|
|
61
61
|
invalidRegexDetected = true;
|
|
62
62
|
}
|
|
63
63
|
var replacement = rules[i].replacement;
|
|
64
64
|
if (replacement && typeof replacement !== 'string') {
|
|
65
|
-
(0, _console.warn)(
|
|
65
|
+
(0, _console.warn)(14);
|
|
66
66
|
invalidReplacementDetected = true;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -30,7 +30,6 @@ function getSubmitMethod() {
|
|
|
30
30
|
return isFinalHarvest && _runtime.isBrowserScope && _runtime.supportsSendBeacon
|
|
31
31
|
// Use sendBeacon for final harvest
|
|
32
32
|
? beacon
|
|
33
|
-
// Only IE does not support sendBeacon for final harvest
|
|
34
33
|
// If not final harvest, or not browserScope, always use xhr post
|
|
35
34
|
: xhr;
|
|
36
35
|
}
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.scopedEE = scopedEE;
|
|
7
7
|
exports.wrapLogger = wrapLogger;
|
|
8
|
-
var _constants = require("../../features/logging/constants");
|
|
9
8
|
var _contextualEe = require("../event-emitter/contextual-ee");
|
|
10
9
|
var _eventContext = require("../event-emitter/event-context");
|
|
11
10
|
var _console = require("../util/console");
|
|
@@ -28,7 +27,7 @@ var _wrapFunction = require("./wrap-function");
|
|
|
28
27
|
*/
|
|
29
28
|
// eslint-disable-next-line
|
|
30
29
|
function wrapLogger(sharedEE, parent, loggerFn, context) {
|
|
31
|
-
if (!(typeof parent === 'object' && !!parent && typeof loggerFn === 'string' && !!loggerFn && typeof parent[loggerFn] === 'function')) return (0, _console.warn)(
|
|
30
|
+
if (!(typeof parent === 'object' && !!parent && typeof loggerFn === 'string' && !!loggerFn && typeof parent[loggerFn] === 'function')) return (0, _console.warn)(29);
|
|
32
31
|
const ee = scopedEE(sharedEE);
|
|
33
32
|
const wrapFn = (0, _wrapFunction.createWrapperWithEmitter)(ee);
|
|
34
33
|
|
|
@@ -56,7 +56,7 @@ function wrapXhr(sharedEE) {
|
|
|
56
56
|
ee.emit('new-xhr', [xhr], context);
|
|
57
57
|
xhr.addEventListener(READY_STATE_CHANGE, wrapXHR(context), (0, _eventListenerOpts.eventListenerOpts)(false));
|
|
58
58
|
} catch (e) {
|
|
59
|
-
(0, _console.warn)(
|
|
59
|
+
(0, _console.warn)(15, e);
|
|
60
60
|
try {
|
|
61
61
|
ee.emit('internal-error', [e]);
|
|
62
62
|
} catch (err) {
|
|
@@ -24,7 +24,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
class Aggregate extends _aggregateBase.AggregateBase {
|
|
27
|
-
static featureName = _constants.FEATURE_NAME;
|
|
27
|
+
static featureName = (() => _constants.FEATURE_NAME)();
|
|
28
28
|
#agentInfo;
|
|
29
29
|
#agentRuntime;
|
|
30
30
|
#agentInit;
|
|
@@ -30,7 +30,7 @@ var handlersLen = handlers.length;
|
|
|
30
30
|
var origRequest = _config.originals.REQ;
|
|
31
31
|
var origXHR = _config.originals.XHR;
|
|
32
32
|
class Instrument extends _instrumentBase.InstrumentBase {
|
|
33
|
-
static featureName = _constants.FEATURE_NAME;
|
|
33
|
+
static featureName = (() => _constants.FEATURE_NAME)();
|
|
34
34
|
constructor(agentIdentifier, aggregator) {
|
|
35
35
|
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
36
36
|
super(agentIdentifier, aggregator, _constants.FEATURE_NAME, auto);
|