@newrelic/browser-agent 1.310.1 → 1.311.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 +16 -0
- package/dist/cjs/common/config/configurable.js +2 -2
- package/dist/cjs/common/config/runtime.js +8 -2
- 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 +17 -4
- package/dist/cjs/common/deny-list/deny-list.js +2 -2
- package/dist/cjs/common/drain/drain.js +27 -37
- package/dist/cjs/common/harvest/harvester.js +1 -3
- package/dist/cjs/common/session/session-entity.js +7 -8
- package/dist/cjs/common/util/console.js +1 -2
- package/dist/cjs/common/util/feature-flags.js +5 -16
- package/dist/cjs/common/util/script-tracker.js +22 -4
- package/dist/cjs/common/util/stringify.js +22 -7
- package/dist/cjs/common/vitals/largest-contentful-paint.js +0 -1
- package/dist/cjs/common/vitals/load-time.js +3 -2
- package/dist/cjs/common/vitals/time-to-first-byte.js +2 -2
- package/dist/cjs/features/jserrors/aggregate/index.js +0 -4
- package/dist/cjs/features/page_view_event/aggregate/index.js +3 -3
- package/dist/cjs/features/page_view_event/aggregate/initialized-features.js +3 -5
- package/dist/cjs/features/page_view_event/instrument/index.js +3 -5
- package/dist/cjs/features/page_view_timing/aggregate/index.js +2 -0
- package/dist/cjs/features/session_trace/aggregate/index.js +4 -3
- package/dist/cjs/features/utils/agent-session.js +3 -4
- package/dist/cjs/features/utils/aggregate-base.js +4 -6
- package/dist/cjs/features/utils/feature-base.js +6 -7
- package/dist/cjs/features/utils/instrument-base.js +7 -8
- package/dist/cjs/loaders/api/register-api-types.js +1 -1
- package/dist/cjs/loaders/api/register.js +1 -1
- package/dist/cjs/loaders/api/sharedHandlers.js +2 -4
- package/dist/cjs/loaders/configure/configure.js +23 -21
- package/dist/esm/common/config/configurable.js +2 -2
- package/dist/esm/common/config/runtime.js +8 -2
- 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 +15 -2
- package/dist/esm/common/deny-list/deny-list.js +2 -2
- package/dist/esm/common/drain/drain.js +27 -36
- package/dist/esm/common/harvest/harvester.js +1 -3
- package/dist/esm/common/session/session-entity.js +7 -8
- package/dist/esm/common/util/console.js +1 -2
- package/dist/esm/common/util/feature-flags.js +5 -14
- package/dist/esm/common/util/script-tracker.js +22 -5
- package/dist/esm/common/util/stringify.js +22 -7
- package/dist/esm/common/vitals/largest-contentful-paint.js +0 -1
- package/dist/esm/common/vitals/load-time.js +4 -3
- package/dist/esm/common/vitals/time-to-first-byte.js +3 -3
- package/dist/esm/features/jserrors/aggregate/index.js +0 -4
- package/dist/esm/features/page_view_event/aggregate/index.js +4 -4
- package/dist/esm/features/page_view_event/aggregate/initialized-features.js +3 -5
- package/dist/esm/features/page_view_event/instrument/index.js +3 -5
- package/dist/esm/features/page_view_timing/aggregate/index.js +3 -1
- package/dist/esm/features/session_trace/aggregate/index.js +5 -4
- package/dist/esm/features/utils/agent-session.js +3 -4
- package/dist/esm/features/utils/aggregate-base.js +4 -6
- package/dist/esm/features/utils/feature-base.js +6 -7
- package/dist/esm/features/utils/instrument-base.js +7 -8
- package/dist/esm/loaders/api/register-api-types.js +1 -1
- package/dist/esm/loaders/api/register.js +1 -1
- package/dist/esm/loaders/api/sharedHandlers.js +2 -4
- package/dist/esm/loaders/configure/configure.js +24 -21
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/common/config/configurable.d.ts.map +1 -1
- package/dist/types/common/config/runtime.d.ts.map +1 -1
- package/dist/types/common/constants/runtime.d.ts +1 -1
- package/dist/types/common/constants/runtime.d.ts.map +1 -1
- package/dist/types/common/drain/drain.d.ts +6 -6
- package/dist/types/common/drain/drain.d.ts.map +1 -1
- package/dist/types/common/harvest/harvester.d.ts.map +1 -1
- package/dist/types/common/session/session-entity.d.ts +2 -2
- package/dist/types/common/session/session-entity.d.ts.map +1 -1
- package/dist/types/common/util/console.d.ts.map +1 -1
- package/dist/types/common/util/feature-flags.d.ts +3 -5
- package/dist/types/common/util/feature-flags.d.ts.map +1 -1
- package/dist/types/common/util/script-tracker.d.ts +5 -0
- package/dist/types/common/util/script-tracker.d.ts.map +1 -1
- package/dist/types/common/util/stringify.d.ts.map +1 -1
- package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_view_event/aggregate/initialized-features.d.ts +2 -2
- package/dist/types/features/page_view_event/aggregate/initialized-features.d.ts.map +1 -1
- package/dist/types/features/page_view_event/instrument/index.d.ts +1 -1
- package/dist/types/features/page_view_event/instrument/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_trace/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 +0 -1
- package/dist/types/features/utils/aggregate-base.d.ts.map +1 -1
- package/dist/types/features/utils/feature-base.d.ts +3 -3
- package/dist/types/features/utils/feature-base.d.ts.map +1 -1
- package/dist/types/features/utils/instrument-base.d.ts +2 -3
- package/dist/types/features/utils/instrument-base.d.ts.map +1 -1
- package/dist/types/loaders/api/register-api-types.d.ts +1 -1
- package/dist/types/loaders/api/register-api-types.d.ts.map +1 -1
- package/dist/types/loaders/api/sharedHandlers.d.ts.map +1 -1
- package/dist/types/loaders/configure/configure.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common/config/configurable.js +2 -1
- package/src/common/config/runtime.js +8 -2
- package/src/common/constants/runtime.js +16 -2
- package/src/common/deny-list/deny-list.js +2 -2
- package/src/common/drain/__mocks__/drain.js +2 -1
- package/src/common/drain/drain.js +27 -37
- package/src/common/harvest/harvester.js +1 -3
- package/src/common/session/session-entity.js +7 -8
- package/src/common/util/console.js +1 -2
- package/src/common/util/feature-flags.js +5 -17
- package/src/common/util/script-tracker.js +23 -5
- package/src/common/util/stringify.js +24 -7
- package/src/common/vitals/largest-contentful-paint.js +0 -1
- package/src/common/vitals/load-time.js +4 -3
- package/src/common/vitals/time-to-first-byte.js +3 -3
- package/src/features/jserrors/aggregate/index.js +0 -4
- package/src/features/page_view_event/aggregate/index.js +4 -4
- package/src/features/page_view_event/aggregate/initialized-features.js +3 -5
- package/src/features/page_view_event/instrument/index.js +3 -5
- package/src/features/page_view_timing/aggregate/index.js +4 -1
- package/src/features/session_trace/aggregate/index.js +5 -4
- package/src/features/utils/__mocks__/feature-base.js +3 -3
- package/src/features/utils/agent-session.js +3 -4
- package/src/features/utils/aggregate-base.js +4 -6
- package/src/features/utils/feature-base.js +6 -7
- package/src/features/utils/instrument-base.js +7 -9
- package/src/loaders/api/register-api-types.js +1 -1
- package/src/loaders/api/register.js +1 -1
- package/src/loaders/api/sharedHandlers.js +2 -4
- package/src/loaders/configure/configure.js +30 -26
- package/dist/cjs/features/utils/nr1-debugger.js +0 -30
- package/dist/esm/features/utils/nr1-debugger.js +0 -23
- package/dist/types/features/utils/nr1-debugger.d.ts +0 -2
- package/dist/types/features/utils/nr1-debugger.d.ts.map +0 -1
- package/src/features/utils/nr1-debugger.js +0 -26
|
@@ -7,7 +7,6 @@ import { isValid } from '../../common/config/info'
|
|
|
7
7
|
import { configure } from '../../loaders/configure/configure'
|
|
8
8
|
import { gosCDN } from '../../common/window/nreum'
|
|
9
9
|
import { drain } from '../../common/drain/drain'
|
|
10
|
-
import { activatedFeatures } from '../../common/util/feature-flags'
|
|
11
10
|
import { Obfuscator } from '../../common/util/obfuscate'
|
|
12
11
|
import { FEATURE_NAMES } from '../../loaders/features/features'
|
|
13
12
|
import { Harvester } from '../../common/harvest/harvester'
|
|
@@ -24,8 +23,7 @@ export class AggregateBase extends FeatureBase {
|
|
|
24
23
|
* @param {string} featureName The name of the feature creating the instance.
|
|
25
24
|
*/
|
|
26
25
|
constructor (agentRef, featureName) {
|
|
27
|
-
super(agentRef
|
|
28
|
-
this.agentRef = agentRef
|
|
26
|
+
super(agentRef, featureName)
|
|
29
27
|
this.checkConfiguration(agentRef)
|
|
30
28
|
this.doOnceForAllAggregate(agentRef)
|
|
31
29
|
|
|
@@ -112,8 +110,8 @@ export class AggregateBase extends FeatureBase {
|
|
|
112
110
|
*/
|
|
113
111
|
waitForFlags (flagNames = []) {
|
|
114
112
|
const flagsPromise = new Promise((resolve, reject) => {
|
|
115
|
-
if (
|
|
116
|
-
resolve(buildOutput(
|
|
113
|
+
if (this.agentRef.runtime?.activatedFeatures) {
|
|
114
|
+
resolve(buildOutput(this.agentRef.runtime.activatedFeatures))
|
|
117
115
|
} else {
|
|
118
116
|
this.ee.on('rumresp', (resp = {}) => {
|
|
119
117
|
resolve(buildOutput(resp))
|
|
@@ -137,7 +135,7 @@ export class AggregateBase extends FeatureBase {
|
|
|
137
135
|
* Stages the feature to be drained
|
|
138
136
|
*/
|
|
139
137
|
drain () {
|
|
140
|
-
drain(this.
|
|
138
|
+
drain(this.agentRef, this.featureName)
|
|
141
139
|
}
|
|
142
140
|
|
|
143
141
|
preHarvestChecks (opts) {
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2020-
|
|
2
|
+
* Copyright 2020-2026 New Relic, Inc. All rights reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { ee } from '../../common/event-emitter/contextual-ee'
|
|
6
5
|
import { deregisterDrain } from '../../common/drain/drain'
|
|
7
6
|
|
|
8
7
|
export class FeatureBase {
|
|
9
|
-
constructor (
|
|
10
|
-
/** @type {
|
|
11
|
-
this.
|
|
8
|
+
constructor (agentRef, featureName) {
|
|
9
|
+
/** @type {Object} */
|
|
10
|
+
this.agentRef = agentRef
|
|
12
11
|
/** @type {import('../../common/event-emitter/contextual-ee').ee} */
|
|
13
|
-
this.ee = ee
|
|
12
|
+
this.ee = agentRef?.ee
|
|
14
13
|
/** @type {string} */
|
|
15
14
|
this.featureName = featureName
|
|
16
15
|
/**
|
|
@@ -22,6 +21,6 @@ export class FeatureBase {
|
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
deregisterDrain () {
|
|
25
|
-
deregisterDrain(this.
|
|
24
|
+
deregisterDrain(this.agentRef, this.featureName)
|
|
26
25
|
}
|
|
27
26
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2020-
|
|
2
|
+
* Copyright 2020-2026 New Relic, Inc. All rights reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -28,13 +28,11 @@ import { handle } from '../../common/event-emitter/handle'
|
|
|
28
28
|
export class InstrumentBase extends FeatureBase {
|
|
29
29
|
/**
|
|
30
30
|
* Instantiate InstrumentBase.
|
|
31
|
-
* @param {
|
|
31
|
+
* @param {Object} agentRef - The agent reference object.
|
|
32
32
|
* @param {string} featureName - The name of the feature module (used to construct file path).
|
|
33
33
|
*/
|
|
34
34
|
constructor (agentRef, featureName) {
|
|
35
|
-
super(agentRef
|
|
36
|
-
|
|
37
|
-
this.agentRef = agentRef
|
|
35
|
+
super(agentRef, featureName)
|
|
38
36
|
|
|
39
37
|
/** @type {Function | undefined} This should be set by any derived Instrument class if it has things to do when feature fails or is killed. */
|
|
40
38
|
this.abortHandler = undefined
|
|
@@ -65,13 +63,13 @@ export class InstrumentBase extends FeatureBase {
|
|
|
65
63
|
this.ee.on('manual-start-all', single(() => {
|
|
66
64
|
// register the feature to drain only once the API has been called, it will drain when importAggregator finishes for all the features
|
|
67
65
|
// called by the api in that cycle
|
|
68
|
-
registerDrain(agentRef
|
|
66
|
+
registerDrain(agentRef, this.featureName)
|
|
69
67
|
resolve()
|
|
70
68
|
}))
|
|
71
69
|
})
|
|
72
70
|
} else {
|
|
73
71
|
/** if the feature requires opt-in (!auto-start), it will get registered once the api has been called */
|
|
74
|
-
registerDrain(agentRef
|
|
72
|
+
registerDrain(agentRef, featureName)
|
|
75
73
|
}
|
|
76
74
|
}
|
|
77
75
|
|
|
@@ -110,7 +108,7 @@ export class InstrumentBase extends FeatureBase {
|
|
|
110
108
|
*/
|
|
111
109
|
try {
|
|
112
110
|
if (!this.#shouldImportAgg(this.featureName, session, agentRef.init)) {
|
|
113
|
-
drain(this.
|
|
111
|
+
drain(this.agentRef, this.featureName)
|
|
114
112
|
this.loadedSuccessfully(false) // aggregate module isn't loaded at all
|
|
115
113
|
return
|
|
116
114
|
}
|
|
@@ -123,7 +121,7 @@ export class InstrumentBase extends FeatureBase {
|
|
|
123
121
|
warn(34, e)
|
|
124
122
|
this.abortHandler?.() // undo any important alterations made to the page
|
|
125
123
|
// not supported yet but nice to do: "abort" this agent's EE for this feature specifically
|
|
126
|
-
drain(this.
|
|
124
|
+
drain(this.agentRef, this.featureName, true)
|
|
127
125
|
this.loadedSuccessfully(false)
|
|
128
126
|
if (this.ee) this.ee.abort()
|
|
129
127
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* @typedef {Object} RegisterAPIConstructor
|
|
23
|
-
* @property {string
|
|
23
|
+
* @property {string} id - The unique id for the registered entity. This will be assigned to any synthesized entities.
|
|
24
24
|
* @property {string} name - The readable name for the registered entity. This will be assigned to any synthesized entities.
|
|
25
25
|
* @property {{[key: string]: any}} [tags] - The tags for the registered entity as key-value pairs. This will be assigned to any synthesized entities. Tags are converted to source.* attributes (e.g., {environment: 'production'} becomes source.environment: 'production').
|
|
26
26
|
* @property {boolean} [isolated] - When true, each registration creates an isolated instance. When false, multiple registrations with the same id and isolated: false will share a single instance, including all custom attributes, ids, names, and metadata. Calling deregister on a shared instance will deregister it for all entities using the instance. Defaults to true.
|
|
@@ -88,7 +88,7 @@ function register (agentRef, target, parent) {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
function hasValidValue (val) {
|
|
91
|
-
return (typeof val === 'string' && !!val.trim() && val.trim().length < 501)
|
|
91
|
+
return (typeof val === 'string' && !!val.trim() && val.trim().length < 501)
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
/** primary cases that can block the register API from working at init time */
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2020-
|
|
2
|
+
* Copyright 2020-2026 New Relic, Inc. All rights reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { dispatchGlobalEvent } from '../../common/dispatch/global-event'
|
|
6
6
|
import { handle } from '../../common/event-emitter/handle'
|
|
7
7
|
import { now } from '../../common/timing/now'
|
|
8
8
|
import { warn } from '../../common/util/console'
|
|
9
|
-
import { activatedFeatures } from '../../common/util/feature-flags'
|
|
10
9
|
import { SUPPORTABILITY_METRIC_CHANNEL } from '../../features/metrics/constants'
|
|
11
10
|
import { AgentBase } from '../agent-base'
|
|
12
11
|
import { FEATURE_NAMES } from '../features/features'
|
|
@@ -28,8 +27,7 @@ export function setupAPI (name, fn, agent, obj) {
|
|
|
28
27
|
api[name] = function () {
|
|
29
28
|
handle(SUPPORTABILITY_METRIC_CHANNEL, ['API/' + name + '/called'], undefined, FEATURE_NAMES.metrics, agent.ee)
|
|
30
29
|
dispatchGlobalEvent({
|
|
31
|
-
|
|
32
|
-
drained: !!activatedFeatures?.[agent.agentIdentifier],
|
|
30
|
+
drained: !!agent.runtime?.activatedFeatures,
|
|
33
31
|
type: 'data',
|
|
34
32
|
name: 'api',
|
|
35
33
|
feature: prefix + name,
|
|
@@ -3,19 +3,16 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { setTopLevelCallers } from '../api/topLevelCallers'
|
|
6
|
-
import {
|
|
6
|
+
import { gosCDN } from '../../common/window/nreum'
|
|
7
7
|
import { mergeInfo } from '../../common/config/info'
|
|
8
8
|
import { mergeInit } from '../../common/config/init'
|
|
9
9
|
import { mergeRuntime } from '../../common/config/runtime'
|
|
10
|
-
import { activatedFeatures } from '../../common/util/feature-flags'
|
|
11
10
|
import { isWorkerScope } from '../../common/constants/runtime'
|
|
12
11
|
import { redefinePublicPath } from './public-path'
|
|
13
12
|
import { ee } from '../../common/event-emitter/contextual-ee'
|
|
14
13
|
import { dispatchGlobalEvent } from '../../common/dispatch/global-event'
|
|
15
14
|
import { mergeLoaderConfig } from '../../common/config/loader-config'
|
|
16
15
|
|
|
17
|
-
const alreadySetOnce = new Set() // the configure() function can run multiple times in agent lifecycle for different agents
|
|
18
|
-
|
|
19
16
|
/**
|
|
20
17
|
* Sets or re-sets the agent's configuration values from global settings. This also attach those as properties to the agent instance.
|
|
21
18
|
* IMPORTANT: setNREUMInitializedAgent must be called on the agent prior to calling this function.
|
|
@@ -42,41 +39,48 @@ export function configure (agent, opts = {}, loaderType, forceDrain) {
|
|
|
42
39
|
agent.info = mergeInfo(info)
|
|
43
40
|
|
|
44
41
|
const updatedInit = agent.init
|
|
45
|
-
const internalTrafficList = [info.beacon, info.errorBeacon]
|
|
46
42
|
|
|
47
|
-
|
|
48
|
-
if (updatedInit.proxy.assets) {
|
|
49
|
-
redefinePublicPath(updatedInit.proxy.assets)
|
|
50
|
-
internalTrafficList.push(updatedInit.proxy.assets)
|
|
51
|
-
}
|
|
52
|
-
if (updatedInit.proxy.beacon) internalTrafficList.push(updatedInit.proxy.beacon)
|
|
53
|
-
agent.beacons = [...internalTrafficList]
|
|
43
|
+
agent.runtime ??= mergeRuntime(runtime)
|
|
54
44
|
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
// Apply proxy settings whenever configure is called (supports late {init} setting)
|
|
46
|
+
if (updatedInit.proxy.assets) {
|
|
47
|
+
redefinePublicPath(updatedInit.proxy.assets)
|
|
57
48
|
}
|
|
58
49
|
|
|
59
|
-
runtime.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
if (!agent.runtime.configured) {
|
|
51
|
+
Object.defineProperty(agent, 'beacons', {
|
|
52
|
+
get () {
|
|
53
|
+
return [agent.info.beacon, agent.info.errorBeacon, agent.init.proxy.assets, agent.init.proxy.beacon].filter(Boolean)
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
Object.defineProperty(agent.runtime, 'denyList', {
|
|
58
|
+
get () {
|
|
59
|
+
// Compute the internal traffic list fresh each time to ensure beacons array is current
|
|
60
|
+
return [
|
|
61
|
+
...(agent.init.ajax.deny_list || []),
|
|
62
|
+
...(agent.init.ajax.block_internal ? agent.beacons : [])
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
agent.runtime.ptid = agent.agentIdentifier
|
|
67
|
+
|
|
68
|
+
setTopLevelCallers(agent) // no need to set global APIs on newrelic obj more than once
|
|
69
|
+
|
|
70
|
+
agent.runtime.loaderType = loaderType
|
|
66
71
|
|
|
67
|
-
if (!alreadySetOnce.has(agent.agentIdentifier)) {
|
|
68
72
|
agent.ee = ee.get(agent.agentIdentifier)
|
|
73
|
+
|
|
69
74
|
agent.exposed = exposed
|
|
70
75
|
|
|
71
76
|
dispatchGlobalEvent({
|
|
72
|
-
|
|
73
|
-
drained: !!activatedFeatures?.[agent.agentIdentifier],
|
|
77
|
+
drained: !!agent.runtime.activatedFeatures,
|
|
74
78
|
type: 'lifecycle',
|
|
75
79
|
name: 'initialize',
|
|
76
80
|
feature: undefined,
|
|
77
81
|
data: agent.config
|
|
78
82
|
})
|
|
79
|
-
}
|
|
80
83
|
|
|
81
|
-
|
|
84
|
+
agent.runtime.configured = true
|
|
85
|
+
}
|
|
82
86
|
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.debugNR1 = debugNR1;
|
|
7
|
-
var _nreum = require("../../common/window/nreum");
|
|
8
|
-
/**
|
|
9
|
-
* Copyright 2020-2025 New Relic, Inc. All rights reserved.
|
|
10
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const debugId = 1;
|
|
14
|
-
const newrelic = (0, _nreum.gosCDN)();
|
|
15
|
-
function debugNR1(agentIdentifier, location, event, otherprops = {}, debugName = 'SR') {
|
|
16
|
-
const api = agentIdentifier ? newrelic.initializedAgents[agentIdentifier].addPageAction : newrelic.addPageAction;
|
|
17
|
-
let url;
|
|
18
|
-
try {
|
|
19
|
-
const locURL = new URL(window.location);
|
|
20
|
-
url = locURL.pathname;
|
|
21
|
-
} catch (err) {}
|
|
22
|
-
api(debugName, {
|
|
23
|
-
debugId,
|
|
24
|
-
url,
|
|
25
|
-
location,
|
|
26
|
-
event,
|
|
27
|
-
now: performance.now(),
|
|
28
|
-
...otherprops
|
|
29
|
-
});
|
|
30
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2020-2025 New Relic, Inc. All rights reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { gosCDN } from '../../common/window/nreum';
|
|
6
|
-
const debugId = 1;
|
|
7
|
-
const newrelic = gosCDN();
|
|
8
|
-
export function debugNR1(agentIdentifier, location, event, otherprops = {}, debugName = 'SR') {
|
|
9
|
-
const api = agentIdentifier ? newrelic.initializedAgents[agentIdentifier].addPageAction : newrelic.addPageAction;
|
|
10
|
-
let url;
|
|
11
|
-
try {
|
|
12
|
-
const locURL = new URL(window.location);
|
|
13
|
-
url = locURL.pathname;
|
|
14
|
-
} catch (err) {}
|
|
15
|
-
api(debugName, {
|
|
16
|
-
debugId,
|
|
17
|
-
url,
|
|
18
|
-
location,
|
|
19
|
-
event,
|
|
20
|
-
now: performance.now(),
|
|
21
|
-
...otherprops
|
|
22
|
-
});
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nr1-debugger.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/nr1-debugger.js"],"names":[],"mappings":"AAQA,qHAiBC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2020-2025 New Relic, Inc. All rights reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { gosCDN } from '../../common/window/nreum'
|
|
6
|
-
|
|
7
|
-
const debugId = 1
|
|
8
|
-
const newrelic = gosCDN()
|
|
9
|
-
export function debugNR1 (agentIdentifier, location, event, otherprops = {}, debugName = 'SR') {
|
|
10
|
-
const api = agentIdentifier ? newrelic.initializedAgents[agentIdentifier].addPageAction : newrelic.addPageAction
|
|
11
|
-
let url
|
|
12
|
-
try {
|
|
13
|
-
const locURL = new URL(window.location)
|
|
14
|
-
url = locURL.pathname
|
|
15
|
-
} catch (err) {
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
api(debugName, {
|
|
19
|
-
debugId,
|
|
20
|
-
url,
|
|
21
|
-
location,
|
|
22
|
-
event,
|
|
23
|
-
now: performance.now(),
|
|
24
|
-
...otherprops
|
|
25
|
-
})
|
|
26
|
-
}
|