@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.
Files changed (131) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/common/config/configurable.js +2 -2
  3. package/dist/cjs/common/config/runtime.js +8 -2
  4. package/dist/cjs/common/constants/env.cdn.js +1 -1
  5. package/dist/cjs/common/constants/env.npm.js +1 -1
  6. package/dist/cjs/common/constants/runtime.js +17 -4
  7. package/dist/cjs/common/deny-list/deny-list.js +2 -2
  8. package/dist/cjs/common/drain/drain.js +27 -37
  9. package/dist/cjs/common/harvest/harvester.js +1 -3
  10. package/dist/cjs/common/session/session-entity.js +7 -8
  11. package/dist/cjs/common/util/console.js +1 -2
  12. package/dist/cjs/common/util/feature-flags.js +5 -16
  13. package/dist/cjs/common/util/script-tracker.js +22 -4
  14. package/dist/cjs/common/util/stringify.js +22 -7
  15. package/dist/cjs/common/vitals/largest-contentful-paint.js +0 -1
  16. package/dist/cjs/common/vitals/load-time.js +3 -2
  17. package/dist/cjs/common/vitals/time-to-first-byte.js +2 -2
  18. package/dist/cjs/features/jserrors/aggregate/index.js +0 -4
  19. package/dist/cjs/features/page_view_event/aggregate/index.js +3 -3
  20. package/dist/cjs/features/page_view_event/aggregate/initialized-features.js +3 -5
  21. package/dist/cjs/features/page_view_event/instrument/index.js +3 -5
  22. package/dist/cjs/features/page_view_timing/aggregate/index.js +2 -0
  23. package/dist/cjs/features/session_trace/aggregate/index.js +4 -3
  24. package/dist/cjs/features/utils/agent-session.js +3 -4
  25. package/dist/cjs/features/utils/aggregate-base.js +4 -6
  26. package/dist/cjs/features/utils/feature-base.js +6 -7
  27. package/dist/cjs/features/utils/instrument-base.js +7 -8
  28. package/dist/cjs/loaders/api/register-api-types.js +1 -1
  29. package/dist/cjs/loaders/api/register.js +1 -1
  30. package/dist/cjs/loaders/api/sharedHandlers.js +2 -4
  31. package/dist/cjs/loaders/configure/configure.js +23 -21
  32. package/dist/esm/common/config/configurable.js +2 -2
  33. package/dist/esm/common/config/runtime.js +8 -2
  34. package/dist/esm/common/constants/env.cdn.js +1 -1
  35. package/dist/esm/common/constants/env.npm.js +1 -1
  36. package/dist/esm/common/constants/runtime.js +15 -2
  37. package/dist/esm/common/deny-list/deny-list.js +2 -2
  38. package/dist/esm/common/drain/drain.js +27 -36
  39. package/dist/esm/common/harvest/harvester.js +1 -3
  40. package/dist/esm/common/session/session-entity.js +7 -8
  41. package/dist/esm/common/util/console.js +1 -2
  42. package/dist/esm/common/util/feature-flags.js +5 -14
  43. package/dist/esm/common/util/script-tracker.js +22 -5
  44. package/dist/esm/common/util/stringify.js +22 -7
  45. package/dist/esm/common/vitals/largest-contentful-paint.js +0 -1
  46. package/dist/esm/common/vitals/load-time.js +4 -3
  47. package/dist/esm/common/vitals/time-to-first-byte.js +3 -3
  48. package/dist/esm/features/jserrors/aggregate/index.js +0 -4
  49. package/dist/esm/features/page_view_event/aggregate/index.js +4 -4
  50. package/dist/esm/features/page_view_event/aggregate/initialized-features.js +3 -5
  51. package/dist/esm/features/page_view_event/instrument/index.js +3 -5
  52. package/dist/esm/features/page_view_timing/aggregate/index.js +3 -1
  53. package/dist/esm/features/session_trace/aggregate/index.js +5 -4
  54. package/dist/esm/features/utils/agent-session.js +3 -4
  55. package/dist/esm/features/utils/aggregate-base.js +4 -6
  56. package/dist/esm/features/utils/feature-base.js +6 -7
  57. package/dist/esm/features/utils/instrument-base.js +7 -8
  58. package/dist/esm/loaders/api/register-api-types.js +1 -1
  59. package/dist/esm/loaders/api/register.js +1 -1
  60. package/dist/esm/loaders/api/sharedHandlers.js +2 -4
  61. package/dist/esm/loaders/configure/configure.js +24 -21
  62. package/dist/tsconfig.tsbuildinfo +1 -1
  63. package/dist/types/common/config/configurable.d.ts.map +1 -1
  64. package/dist/types/common/config/runtime.d.ts.map +1 -1
  65. package/dist/types/common/constants/runtime.d.ts +1 -1
  66. package/dist/types/common/constants/runtime.d.ts.map +1 -1
  67. package/dist/types/common/drain/drain.d.ts +6 -6
  68. package/dist/types/common/drain/drain.d.ts.map +1 -1
  69. package/dist/types/common/harvest/harvester.d.ts.map +1 -1
  70. package/dist/types/common/session/session-entity.d.ts +2 -2
  71. package/dist/types/common/session/session-entity.d.ts.map +1 -1
  72. package/dist/types/common/util/console.d.ts.map +1 -1
  73. package/dist/types/common/util/feature-flags.d.ts +3 -5
  74. package/dist/types/common/util/feature-flags.d.ts.map +1 -1
  75. package/dist/types/common/util/script-tracker.d.ts +5 -0
  76. package/dist/types/common/util/script-tracker.d.ts.map +1 -1
  77. package/dist/types/common/util/stringify.d.ts.map +1 -1
  78. package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
  79. package/dist/types/features/page_view_event/aggregate/initialized-features.d.ts +2 -2
  80. package/dist/types/features/page_view_event/aggregate/initialized-features.d.ts.map +1 -1
  81. package/dist/types/features/page_view_event/instrument/index.d.ts +1 -1
  82. package/dist/types/features/page_view_event/instrument/index.d.ts.map +1 -1
  83. package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
  84. package/dist/types/features/session_trace/aggregate/index.d.ts.map +1 -1
  85. package/dist/types/features/utils/agent-session.d.ts.map +1 -1
  86. package/dist/types/features/utils/aggregate-base.d.ts +0 -1
  87. package/dist/types/features/utils/aggregate-base.d.ts.map +1 -1
  88. package/dist/types/features/utils/feature-base.d.ts +3 -3
  89. package/dist/types/features/utils/feature-base.d.ts.map +1 -1
  90. package/dist/types/features/utils/instrument-base.d.ts +2 -3
  91. package/dist/types/features/utils/instrument-base.d.ts.map +1 -1
  92. package/dist/types/loaders/api/register-api-types.d.ts +1 -1
  93. package/dist/types/loaders/api/register-api-types.d.ts.map +1 -1
  94. package/dist/types/loaders/api/sharedHandlers.d.ts.map +1 -1
  95. package/dist/types/loaders/configure/configure.d.ts.map +1 -1
  96. package/package.json +1 -1
  97. package/src/common/config/configurable.js +2 -1
  98. package/src/common/config/runtime.js +8 -2
  99. package/src/common/constants/runtime.js +16 -2
  100. package/src/common/deny-list/deny-list.js +2 -2
  101. package/src/common/drain/__mocks__/drain.js +2 -1
  102. package/src/common/drain/drain.js +27 -37
  103. package/src/common/harvest/harvester.js +1 -3
  104. package/src/common/session/session-entity.js +7 -8
  105. package/src/common/util/console.js +1 -2
  106. package/src/common/util/feature-flags.js +5 -17
  107. package/src/common/util/script-tracker.js +23 -5
  108. package/src/common/util/stringify.js +24 -7
  109. package/src/common/vitals/largest-contentful-paint.js +0 -1
  110. package/src/common/vitals/load-time.js +4 -3
  111. package/src/common/vitals/time-to-first-byte.js +3 -3
  112. package/src/features/jserrors/aggregate/index.js +0 -4
  113. package/src/features/page_view_event/aggregate/index.js +4 -4
  114. package/src/features/page_view_event/aggregate/initialized-features.js +3 -5
  115. package/src/features/page_view_event/instrument/index.js +3 -5
  116. package/src/features/page_view_timing/aggregate/index.js +4 -1
  117. package/src/features/session_trace/aggregate/index.js +5 -4
  118. package/src/features/utils/__mocks__/feature-base.js +3 -3
  119. package/src/features/utils/agent-session.js +3 -4
  120. package/src/features/utils/aggregate-base.js +4 -6
  121. package/src/features/utils/feature-base.js +6 -7
  122. package/src/features/utils/instrument-base.js +7 -9
  123. package/src/loaders/api/register-api-types.js +1 -1
  124. package/src/loaders/api/register.js +1 -1
  125. package/src/loaders/api/sharedHandlers.js +2 -4
  126. package/src/loaders/configure/configure.js +30 -26
  127. package/dist/cjs/features/utils/nr1-debugger.js +0 -30
  128. package/dist/esm/features/utils/nr1-debugger.js +0 -23
  129. package/dist/types/features/utils/nr1-debugger.d.ts +0 -2
  130. package/dist/types/features/utils/nr1-debugger.d.ts.map +0 -1
  131. 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.agentIdentifier, featureName)
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 (activatedFeatures[this.agentIdentifier]) {
116
- resolve(buildOutput(activatedFeatures[this.agentIdentifier]))
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.agentIdentifier, this.featureName)
138
+ drain(this.agentRef, this.featureName)
141
139
  }
142
140
 
143
141
  preHarvestChecks (opts) {
@@ -1,16 +1,15 @@
1
1
  /**
2
- * Copyright 2020-2025 New Relic, Inc. All rights reserved.
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 (agentIdentifier, featureName) {
10
- /** @type {string} */
11
- this.agentIdentifier = agentIdentifier
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.get(agentIdentifier)
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.agentIdentifier, this.featureName)
24
+ deregisterDrain(this.agentRef, this.featureName)
26
25
  }
27
26
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2020-2025 New Relic, Inc. All rights reserved.
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 {string} agentIdentifier - The unique ID of the instantiated agent (relative to global scope).
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.agentIdentifier, featureName)
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.agentIdentifier, this.featureName)
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.agentIdentifier, featureName)
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.agentIdentifier, this.featureName)
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.agentIdentifier, this.featureName, true)
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|number} id - The unique id for the registered entity. This will be assigned to any synthesized entities.
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) || (typeof val === 'number')
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-2025 New Relic, Inc. All rights reserved.
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
- agentIdentifier: agent.agentIdentifier,
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 { addToNREUM, gosCDN } from '../../common/window/nreum'
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
- if (!alreadySetOnce.has(agent.agentIdentifier)) {
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
- setTopLevelCallers(agent) // no need to set global APIs on newrelic obj more than once
56
- addToNREUM('activatedFeatures', activatedFeatures)
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.denyList = [
60
- ...(updatedInit.ajax.deny_list || []),
61
- ...(updatedInit.ajax.block_internal ? internalTrafficList : [])
62
- ]
63
- runtime.ptid = agent.agentIdentifier
64
- runtime.loaderType = loaderType
65
- agent.runtime = mergeRuntime(runtime)
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
- agentIdentifier: agent.agentIdentifier,
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
- alreadySetOnce.add(agent.agentIdentifier)
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,2 +0,0 @@
1
- export function debugNR1(agentIdentifier: any, location: any, event: any, otherprops?: {}, debugName?: string): void;
2
- //# sourceMappingURL=nr1-debugger.d.ts.map
@@ -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
- }