@newrelic/browser-agent 1.304.0 → 1.305.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 (72) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/common/constants/env.cdn.js +1 -1
  3. package/dist/cjs/common/constants/env.npm.js +1 -1
  4. package/dist/cjs/common/constants/runtime.js +4 -2
  5. package/dist/cjs/common/timing/nav-timing.js +7 -2
  6. package/dist/cjs/common/util/mfe.js +4 -4
  7. package/dist/cjs/common/vitals/constants.js +1 -0
  8. package/dist/cjs/common/vitals/load-time.js +27 -0
  9. package/dist/cjs/common/vitals/time-to-first-byte.js +1 -1
  10. package/dist/cjs/common/window/load.js +19 -1
  11. package/dist/cjs/features/generic_events/aggregate/index.js +1 -1
  12. package/dist/cjs/features/generic_events/aggregate/user-actions/user-actions-aggregator.js +5 -9
  13. package/dist/cjs/features/generic_events/instrument/index.js +28 -33
  14. package/dist/cjs/features/page_view_event/aggregate/index.js +7 -8
  15. package/dist/cjs/features/page_view_timing/aggregate/index.js +5 -4
  16. package/dist/cjs/features/session_trace/aggregate/index.js +1 -1
  17. package/dist/cjs/features/soft_navigations/aggregate/index.js +3 -5
  18. package/dist/cjs/features/spa/instrument/index.js +8 -0
  19. package/dist/cjs/loaders/api/register.js +1 -1
  20. package/dist/esm/common/constants/env.cdn.js +1 -1
  21. package/dist/esm/common/constants/env.npm.js +1 -1
  22. package/dist/esm/common/constants/runtime.js +2 -1
  23. package/dist/esm/common/timing/nav-timing.js +7 -2
  24. package/dist/esm/common/util/mfe.js +4 -4
  25. package/dist/esm/common/vitals/constants.js +1 -0
  26. package/dist/esm/common/vitals/load-time.js +20 -0
  27. package/dist/esm/common/vitals/time-to-first-byte.js +2 -2
  28. package/dist/esm/common/window/load.js +19 -1
  29. package/dist/esm/features/generic_events/aggregate/index.js +1 -1
  30. package/dist/esm/features/generic_events/aggregate/user-actions/user-actions-aggregator.js +5 -9
  31. package/dist/esm/features/generic_events/instrument/index.js +28 -33
  32. package/dist/esm/features/page_view_event/aggregate/index.js +8 -9
  33. package/dist/esm/features/page_view_timing/aggregate/index.js +5 -4
  34. package/dist/esm/features/session_trace/aggregate/index.js +2 -2
  35. package/dist/esm/features/soft_navigations/aggregate/index.js +3 -5
  36. package/dist/esm/features/spa/instrument/index.js +8 -0
  37. package/dist/esm/loaders/api/register.js +1 -1
  38. package/dist/tsconfig.tsbuildinfo +1 -1
  39. package/dist/types/common/constants/runtime.d.ts +1 -0
  40. package/dist/types/common/constants/runtime.d.ts.map +1 -1
  41. package/dist/types/common/timing/nav-timing.d.ts.map +1 -1
  42. package/dist/types/common/util/mfe.d.ts +2 -5
  43. package/dist/types/common/util/mfe.d.ts.map +1 -1
  44. package/dist/types/common/vitals/constants.d.ts +1 -0
  45. package/dist/types/common/vitals/load-time.d.ts +3 -0
  46. package/dist/types/common/vitals/load-time.d.ts.map +1 -0
  47. package/dist/types/common/window/load.d.ts +10 -1
  48. package/dist/types/common/window/load.d.ts.map +1 -1
  49. package/dist/types/features/generic_events/aggregate/user-actions/user-actions-aggregator.d.ts +0 -1
  50. package/dist/types/features/generic_events/aggregate/user-actions/user-actions-aggregator.d.ts.map +1 -1
  51. package/dist/types/features/generic_events/instrument/index.d.ts.map +1 -1
  52. package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -1
  53. package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
  54. package/dist/types/features/soft_navigations/aggregate/index.d.ts.map +1 -1
  55. package/dist/types/features/spa/instrument/index.d.ts.map +1 -1
  56. package/package.json +1 -1
  57. package/src/common/constants/runtime.js +2 -0
  58. package/src/common/timing/nav-timing.js +7 -2
  59. package/src/common/util/mfe.js +4 -4
  60. package/src/common/vitals/constants.js +1 -0
  61. package/src/common/vitals/load-time.js +23 -0
  62. package/src/common/vitals/time-to-first-byte.js +2 -2
  63. package/src/common/window/load.js +18 -1
  64. package/src/features/generic_events/aggregate/index.js +1 -1
  65. package/src/features/generic_events/aggregate/user-actions/user-actions-aggregator.js +5 -9
  66. package/src/features/generic_events/instrument/index.js +35 -37
  67. package/src/features/page_view_event/aggregate/index.js +8 -9
  68. package/src/features/page_view_timing/aggregate/index.js +2 -4
  69. package/src/features/session_trace/aggregate/index.js +2 -2
  70. package/src/features/soft_navigations/aggregate/index.js +3 -4
  71. package/src/features/spa/instrument/index.js +6 -0
  72. package/src/loaders/api/register.js +1 -1
@@ -11,14 +11,12 @@ export class UserActionsAggregator {
11
11
  /** @type {AggregatedUserAction=} */
12
12
  #aggregationEvent = undefined;
13
13
  #aggregationKey = '';
14
- #ufEnabled = false;
15
14
  #deadClickTimer = undefined;
16
15
  #domObserver = undefined;
17
16
  #errorClickTimer = undefined;
18
- constructor(userFrustrationsEnabled) {
19
- if (userFrustrationsEnabled && gosNREUMOriginals().o.MO) {
17
+ constructor() {
18
+ if (gosNREUMOriginals().o.MO) {
20
19
  this.#domObserver = new MutationObserver(this.isLiveClick.bind(this));
21
- this.#ufEnabled = true;
22
20
  }
23
21
  }
24
22
  get aggregationEvent() {
@@ -49,15 +47,13 @@ export class UserActionsAggregator {
49
47
  } else {
50
48
  // return the prev existing one (if there is one)
51
49
  const finishedEvent = this.#aggregationEvent;
52
- if (this.#ufEnabled) {
53
- this.#deadClickCleanup();
54
- this.#errorClickCleanup();
55
- }
50
+ this.#deadClickCleanup();
51
+ this.#errorClickCleanup();
56
52
 
57
53
  // then start new event aggregation
58
54
  this.#aggregationKey = aggregationKey;
59
55
  this.#aggregationEvent = new AggregatedUserAction(evt, selectorInfo);
60
- if (this.#ufEnabled && evt.type === 'click' && (selectorInfo.hasButton || selectorInfo.hasLink)) {
56
+ if (evt.type === 'click' && (selectorInfo.hasButton || selectorInfo.hasLink)) {
61
57
  this.#deadClickSetup(this.#aggregationEvent);
62
58
  this.#errorClickSetup();
63
59
  }
@@ -26,7 +26,6 @@ export class Instrument extends InstrumentBase {
26
26
  constructor(agentRef) {
27
27
  super(agentRef, FEATURE_NAME);
28
28
  const websocketsEnabled = agentRef.init.feature_flags.includes('websockets');
29
- const ufEnabled = agentRef.init.feature_flags.includes('user_frustrations');
30
29
 
31
30
  /** config values that gate whether the generic events aggregator should be imported at all */
32
31
  const genericEventSourceConfigs = [agentRef.init.page_action.enabled, agentRef.init.performance.capture_marks, agentRef.init.performance.capture_measures, agentRef.init.performance.resources.enabled, agentRef.init.user_actions.enabled, websocketsEnabled];
@@ -38,13 +37,11 @@ export class Instrument extends InstrumentBase {
38
37
  setupRegisterAPI(agentRef);
39
38
  setupMeasureAPI(agentRef);
40
39
  let historyEE, websocketsEE;
41
- if (isBrowserScope && ufEnabled) {
40
+ if (websocketsEnabled) websocketsEE = wrapWebSocket(this.ee);
41
+ if (isBrowserScope) {
42
42
  wrapFetch(this.ee);
43
43
  wrapXhr(this.ee);
44
44
  historyEE = wrapHistory(this.ee);
45
- }
46
- if (websocketsEnabled) websocketsEE = wrapWebSocket(this.ee);
47
- if (isBrowserScope) {
48
45
  if (agentRef.init.user_actions.enabled) {
49
46
  OBSERVED_EVENTS.forEach(eventType => windowAddEventListener(eventType, evt => handle('ua', [evt], undefined, this.featureName, this.ee), true));
50
47
  OBSERVED_WINDOW_EVENTS.forEach(eventType => {
@@ -57,36 +54,34 @@ export class Instrument extends InstrumentBase {
57
54
  }
58
55
  // Capture is not used here so that we don't get element focus/blur events, only the window's as they do not bubble. They are also not cancellable, so no worries about being front of line.
59
56
  );
60
- if (ufEnabled) {
61
- globalScope.addEventListener('error', () => {
62
- handle('uaErr', [], undefined, FEATURE_NAMES.genericEvents, this.ee);
63
- }, eventListenerOpts(false, this.removeOnAbort?.signal));
64
- this.ee.on('open-xhr-start', (args, xhr) => {
65
- if (!isInternalTraffic(args[1])) {
66
- xhr.addEventListener('readystatechange', () => {
67
- if (xhr.readyState === 2) {
68
- // HEADERS_RECEIVED
69
- handle('uaXhr', [], undefined, FEATURE_NAMES.genericEvents, this.ee);
70
- }
71
- });
72
- }
73
- });
74
- this.ee.on('fetch-start', fetchArguments => {
75
- if (fetchArguments.length >= 1 && !isInternalTraffic(extractUrl(fetchArguments[0]))) {
76
- handle('uaXhr', [], undefined, FEATURE_NAMES.genericEvents, this.ee);
77
- }
78
- });
79
- function isInternalTraffic(url) {
80
- const parsedUrl = parseUrl(url);
81
- return agentRef.beacons.includes(parsedUrl.hostname + ':' + parsedUrl.port);
57
+ globalScope.addEventListener('error', () => {
58
+ handle('uaErr', [], undefined, FEATURE_NAMES.genericEvents, this.ee);
59
+ }, eventListenerOpts(false, this.removeOnAbort?.signal));
60
+ this.ee.on('open-xhr-start', (args, xhr) => {
61
+ if (!isInternalTraffic(args[1])) {
62
+ xhr.addEventListener('readystatechange', () => {
63
+ if (xhr.readyState === 2) {
64
+ // HEADERS_RECEIVED
65
+ handle('uaXhr', [], undefined, FEATURE_NAMES.genericEvents, this.ee);
66
+ }
67
+ });
82
68
  }
83
- historyEE.on('pushState-end', navigationChange);
84
- historyEE.on('replaceState-end', navigationChange);
85
- window.addEventListener('hashchange', navigationChange, eventListenerOpts(true, this.removeOnAbort?.signal));
86
- window.addEventListener('popstate', navigationChange, eventListenerOpts(true, this.removeOnAbort?.signal));
87
- function navigationChange() {
88
- historyEE.emit('navChange');
69
+ });
70
+ this.ee.on('fetch-start', fetchArguments => {
71
+ if (fetchArguments.length >= 1 && !isInternalTraffic(extractUrl(fetchArguments[0]))) {
72
+ handle('uaXhr', [], undefined, FEATURE_NAMES.genericEvents, this.ee);
89
73
  }
74
+ });
75
+ function isInternalTraffic(url) {
76
+ const parsedUrl = parseUrl(url);
77
+ return agentRef.beacons.includes(parsedUrl.hostname + ':' + parsedUrl.port);
78
+ }
79
+ historyEE.on('pushState-end', navigationChange);
80
+ historyEE.on('replaceState-end', navigationChange);
81
+ window.addEventListener('hashchange', navigationChange, eventListenerOpts(true, this.removeOnAbort?.signal));
82
+ window.addEventListener('popstate', navigationChange, eventListenerOpts(true, this.removeOnAbort?.signal));
83
+ function navigationChange() {
84
+ historyEE.emit('navChange');
90
85
  }
91
86
  }
92
87
  if (agentRef.init.performance.resources.enabled && globalScope.PerformanceObserver?.supportedEntryTypes.includes('resource')) {
@@ -2,7 +2,7 @@
2
2
  * Copyright 2020-2025 New Relic, Inc. All rights reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- import { globalScope, isBrowserScope, originTime } from '../../../common/constants/runtime';
5
+ import { globalScope, isBrowserScope, originTime, supportsNavTimingL2 } from '../../../common/constants/runtime';
6
6
  import { addPT, addPN } from '../../../common/timing/nav-timing';
7
7
  import { stringify } from '../../../common/util/stringify';
8
8
  import { isValid } from '../../../common/config/info';
@@ -44,9 +44,8 @@ export class Aggregate extends AggregateBase {
44
44
  this.timeToFirstByte = Math.max(value, this.timeToFirstByte);
45
45
  this.firstByteToWindowLoad = Math.max(Math.round(navEntry.loadEventEnd - this.timeToFirstByte), this.firstByteToWindowLoad); // our "frontend" duration
46
46
  this.firstByteToDomContent = Math.max(Math.round(navEntry.domContentLoadedEventEnd - this.timeToFirstByte), this.firstByteToDomContent); // our "dom processing" duration
47
-
48
- this.sendRum();
49
47
  });
48
+ setTimeout(this.sendRum.bind(this), 0); // we want to sendRum after ttfb has reported something, but we dont want to wait forever incase TTFB fails to report in niche environments.
50
49
  } else {
51
50
  // worker agent build does not get TTFB values, use default 0 values
52
51
  this.sendRum();
@@ -90,7 +89,7 @@ export class Aggregate extends AggregateBase {
90
89
  }, this.obfuscator.obfuscateString.bind(this.obfuscator), 'string');
91
90
  }
92
91
  if (globalScope.performance) {
93
- if (typeof PerformanceNavigationTiming !== 'undefined') {
92
+ if (supportsNavTimingL2()) {
94
93
  // Navigation Timing level 2 API that replaced PerformanceTiming & PerformanceNavigation
95
94
  const navTimingEntry = globalScope?.performance?.getEntriesByType('navigation')?.[0];
96
95
  const perf = {
@@ -99,7 +98,7 @@ export class Aggregate extends AggregateBase {
99
98
  };
100
99
  queryParameters.perf = stringify(perf);
101
100
  } else if (typeof PerformanceTiming !== 'undefined') {
102
- // Safari pre-15 did not support level 2 timing
101
+ // Modern Safari iFrames and Safari pre-15 do not support level 2 timing.
103
102
  const perf = {
104
103
  timing: addPT(originTime, globalScope.performance.timing, {}, true),
105
104
  navigation: addPN(globalScope.performance.navigation, {})
@@ -167,19 +166,19 @@ export class Aggregate extends AggregateBase {
167
166
  const encoded = textEncoder.encode(value);
168
167
  return acc + encoded.byteLength;
169
168
  }, 0);
170
-
169
+ const BCSError = 'BCS/Error/';
171
170
  // Send SMs about failed RUM request
172
171
  const body = {
173
172
  sm: [{
174
173
  params: {
175
- name: "Browser/Supportability/BCS/Error/".concat(status)
174
+ name: BCSError + status
176
175
  },
177
176
  stats: {
178
177
  c: 1
179
178
  }
180
179
  }, {
181
180
  params: {
182
- name: 'Browser/Supportability/BCS/Error/Dropped/Bytes'
181
+ name: BCSError + 'Dropped/Bytes'
183
182
  },
184
183
  stats: {
185
184
  c: 1,
@@ -187,7 +186,7 @@ export class Aggregate extends AggregateBase {
187
186
  }
188
187
  }, {
189
188
  params: {
190
- name: 'Browser/Supportability/BCS/Error/Duration/Ms'
189
+ name: BCSError + 'Duration/Ms'
191
190
  },
192
191
  stats: {
193
192
  c: 1,
@@ -14,11 +14,11 @@ import { firstContentfulPaint } from '../../../common/vitals/first-contentful-pa
14
14
  import { firstPaint } from '../../../common/vitals/first-paint';
15
15
  import { interactionToNextPaint } from '../../../common/vitals/interaction-to-next-paint';
16
16
  import { largestContentfulPaint } from '../../../common/vitals/largest-contentful-paint';
17
- import { timeToFirstByte } from '../../../common/vitals/time-to-first-byte';
18
17
  import { subscribeToVisibilityChange } from '../../../common/window/page-visibility';
19
18
  import { VITAL_NAMES } from '../../../common/vitals/constants';
20
19
  import { initiallyHidden } from '../../../common/constants/runtime';
21
20
  import { eventOrigin } from '../../../common/util/event-origin';
21
+ import { loadTime } from '../../../common/vitals/load-time';
22
22
  export class Aggregate extends AggregateBase {
23
23
  static featureName = FEATURE_NAME;
24
24
  #handleVitalMetric = ({
@@ -41,10 +41,11 @@ export class Aggregate extends AggregateBase {
41
41
  firstContentfulPaint.subscribe(this.#handleVitalMetric);
42
42
  largestContentfulPaint.subscribe(this.#handleVitalMetric);
43
43
  interactionToNextPaint.subscribe(this.#handleVitalMetric);
44
- timeToFirstByte.subscribe(({
45
- attrs
44
+ loadTime.subscribe(({
45
+ name,
46
+ value
46
47
  }) => {
47
- this.addTiming('load', Math.round(attrs.navigationEntry.loadEventEnd));
48
+ this.addTiming(name, Math.round(value));
48
49
  });
49
50
  subscribeToVisibilityChange(() => {
50
51
  /* Downstream, the event consumer interprets all timing node value as ms-unit and converts it to seconds via division by 1000. CLS is unitless so this normally is a problem.
@@ -7,7 +7,7 @@ import { FEATURE_NAME } from '../constants';
7
7
  import { AggregateBase } from '../../utils/aggregate-base';
8
8
  import { TraceStorage } from './trace/storage';
9
9
  import { obj as encodeObj } from '../../../common/url/encode';
10
- import { globalScope } from '../../../common/constants/runtime';
10
+ import { globalScope, supportsNavTimingL2 } from '../../../common/constants/runtime';
11
11
  import { MODE, SESSION_EVENTS } from '../../../common/session/constants';
12
12
  import { applyFnToProps } from '../../../common/util/traverse';
13
13
  import { cleanURL } from '../../../common/url/clean-url';
@@ -58,7 +58,7 @@ export class Aggregate extends AggregateBase {
58
58
  // if another page's session entity has expired, or another page has transitioned to off and this one hasn't... we can just abort straight away here
59
59
  if (this.sessionId !== sessionState.value || eventType === 'cross-tab' && sessionState.sessionTraceMode === MODE.OFF) this.abort(2);
60
60
  });
61
- if (typeof PerformanceNavigationTiming !== 'undefined') {
61
+ if (supportsNavTimingL2()) {
62
62
  this.traceStorage.storeTiming(globalScope.performance?.getEntriesByType?.('navigation')[0]);
63
63
  } else {
64
64
  this.traceStorage.storeTiming(globalScope.performance?.timing, true);
@@ -5,7 +5,7 @@
5
5
  import { handle } from '../../../common/event-emitter/handle';
6
6
  import { registerHandler } from '../../../common/event-emitter/register-handler';
7
7
  import { single } from '../../../common/util/invoke';
8
- import { timeToFirstByte } from '../../../common/vitals/time-to-first-byte';
8
+ import { loadTime } from '../../../common/vitals/load-time';
9
9
  import { FEATURE_NAMES } from '../../../loaders/features/features';
10
10
  import { AggregateBase } from '../../utils/aggregate-base';
11
11
  import { API_TRIGGER_NAME, FEATURE_NAME, INTERACTION_STATUS, INTERACTION_TRIGGERS, IPL_TRIGGER_NAME, NO_LONG_TASK_WINDOW, POPSTATE_MERGE_WINDOW, POPSTATE_TRIGGER } from '../constants';
@@ -30,12 +30,10 @@ export class Aggregate extends AggregateBase {
30
30
  this.events.add(ixn); // add the iPL ixn to the buffer for harvest
31
31
  this.initialPageLoadInteraction = null;
32
32
  });
33
- timeToFirstByte.subscribe(({
34
- attrs
33
+ loadTime.subscribe(({
34
+ value: loadEventTime
35
35
  }) => {
36
- const loadEventTime = attrs.navigationEntry.loadEventEnd;
37
36
  this.initialPageLoadInteraction.done(loadEventTime);
38
- // Report metric on the initial page load time
39
37
  this.reportSupportabilityMetric('SoftNav/Interaction/InitialPageLoad/Duration/Ms', Math.round(loadEventTime));
40
38
  });
41
39
  this.latestRouteSetByApi = null;
@@ -16,6 +16,7 @@ import { wrapFetch } from '../../../common/wrap/wrap-fetch';
16
16
  import { wrapHistory } from '../../../common/wrap/wrap-history';
17
17
  import { wrapMutation } from '../../../common/wrap/wrap-mutation';
18
18
  import { setupInteractionAPI } from '../../../loaders/api/interaction';
19
+ import { onWindowLoad } from '../../../common/window/load';
19
20
  const {
20
21
  FEATURE_NAME,
21
22
  START,
@@ -81,6 +82,13 @@ export class Instrument extends InstrumentBase {
81
82
  timestamp(jsonpEE, 'cb-start');
82
83
  historyEE.on('pushState-end', trackURLChange);
83
84
  historyEE.on('replaceState-end', trackURLChange);
85
+
86
+ /** niche cases like GPT apps cause no window.load event to fire - which breaks IPLs - so manually force one through the pipe */
87
+ onWindowLoad(() => {
88
+ eventsEE.emit(FN_START, [[{
89
+ type: 'load'
90
+ }], window], undefined, true);
91
+ });
84
92
  window.addEventListener('hashchange', trackURLChange, eventListenerOpts(true, this.removeOnAbort?.signal));
85
93
  window.addEventListener('load', trackURLChange, eventListenerOpts(true, this.removeOnAbort?.signal));
86
94
  window.addEventListener('popstate', function () {
@@ -44,7 +44,7 @@ function register(agentRef, target, parent) {
44
44
  const attrs = {};
45
45
  warn(54, 'newrelic.register');
46
46
  target ||= {};
47
- target.eventSource = 'MicroFrontendBrowserAgent';
47
+ target.type = 'MFE';
48
48
  target.licenseKey ||= agentRef.info.licenseKey; // will inherit the license key from the container agent if not provided for brevity. A future state may dictate that we need different license keys to do different things.
49
49
  target.blocked = false;
50
50
  target.parent = parent || {};
@@ -1 +1 @@
1
- {"root":["../src/index.js","../src/cdn/experimental.js","../src/cdn/lite.js","../src/cdn/pro.js","../src/cdn/spa.js","../src/common/aggregate/aggregator.js","../src/common/aggregate/event-aggregator.js","../src/common/config/configurable.js","../src/common/config/info.js","../src/common/config/init-types.js","../src/common/config/init.js","../src/common/config/loader-config.js","../src/common/config/runtime.js","../src/common/constants/agent-constants.js","../src/common/constants/env.cdn.js","../src/common/constants/env.js","../src/common/constants/env.npm.js","../src/common/constants/runtime.js","../src/common/constants/shared-channel.js","../src/common/deny-list/deny-list.js","../src/common/dispatch/global-event.js","../src/common/dom/iframe.js","../src/common/dom/query-selector.js","../src/common/dom/selector-path.js","../src/common/drain/drain.js","../src/common/event-emitter/contextual-ee.js","../src/common/event-emitter/event-context.js","../src/common/event-emitter/handle.js","../src/common/event-emitter/register-handler.js","../src/common/event-listener/event-listener-opts.js","../src/common/harvest/harvester.js","../src/common/harvest/types.js","../src/common/ids/bundle-id.js","../src/common/ids/id.js","../src/common/ids/unique-id.js","../src/common/serialize/bel-serializer.js","../src/common/session/constants.js","../src/common/session/session-entity.js","../src/common/storage/local-storage.js","../src/common/timer/interaction-timer.js","../src/common/timer/timer.js","../src/common/timing/nav-timing.js","../src/common/timing/now.js","../src/common/timing/time-keeper.js","../src/common/unload/eol.js","../src/common/url/canonicalize-url.js","../src/common/url/clean-url.js","../src/common/url/encode.js","../src/common/url/extract-url.js","../src/common/url/location.js","../src/common/url/parse-url.js","../src/common/url/protocol.js","../src/common/util/attribute-size.js","../src/common/util/console.js","../src/common/util/data-size.js","../src/common/util/event-origin.js","../src/common/util/feature-flags.js","../src/common/util/get-or-set.js","../src/common/util/invoke.js","../src/common/util/mfe.js","../src/common/util/monkey-patched.js","../src/common/util/obfuscate.js","../src/common/util/stringify.js","../src/common/util/submit-data.js","../src/common/util/text.js","../src/common/util/traverse.js","../src/common/util/type-check.js","../src/common/vitals/constants.js","../src/common/vitals/cumulative-layout-shift.js","../src/common/vitals/first-contentful-paint.js","../src/common/vitals/first-paint.js","../src/common/vitals/interaction-to-next-paint.js","../src/common/vitals/largest-contentful-paint.js","../src/common/vitals/time-to-first-byte.js","../src/common/vitals/vital-metric.js","../src/common/window/load.js","../src/common/window/nreum.js","../src/common/window/page-visibility.js","../src/common/wrap/wrap-events.js","../src/common/wrap/wrap-fetch.js","../src/common/wrap/wrap-function.js","../src/common/wrap/wrap-history.js","../src/common/wrap/wrap-jsonp.js","../src/common/wrap/wrap-logger.js","../src/common/wrap/wrap-mutation.js","../src/common/wrap/wrap-promise.js","../src/common/wrap/wrap-timer.js","../src/common/wrap/wrap-websocket.js","../src/common/wrap/wrap-xhr.js","../src/features/ajax/constants.js","../src/features/ajax/index.js","../src/features/ajax/aggregate/gql.js","../src/features/ajax/aggregate/index.js","../src/features/ajax/instrument/distributed-tracing.js","../src/features/ajax/instrument/index.js","../src/features/ajax/instrument/response-size.js","../src/features/generic_events/constants.js","../src/features/generic_events/index.js","../src/features/generic_events/aggregate/index.js","../src/features/generic_events/aggregate/user-actions/aggregated-user-action.js","../src/features/generic_events/aggregate/user-actions/user-actions-aggregator.js","../src/features/generic_events/instrument/index.js","../src/features/jserrors/constants.js","../src/features/jserrors/index.js","../src/features/jserrors/aggregate/canonical-function-name.js","../src/features/jserrors/aggregate/cause-string.js","../src/features/jserrors/aggregate/compute-stack-trace.js","../src/features/jserrors/aggregate/format-stack-trace.js","../src/features/jserrors/aggregate/index.js","../src/features/jserrors/aggregate/internal-errors.js","../src/features/jserrors/aggregate/string-hash-code.js","../src/features/jserrors/instrument/index.js","../src/features/jserrors/shared/cast-error.js","../src/features/jserrors/shared/uncaught-error.js","../src/features/logging/constants.js","../src/features/logging/index.js","../src/features/logging/aggregate/index.js","../src/features/logging/instrument/index.js","../src/features/logging/shared/log.js","../src/features/logging/shared/utils.js","../src/features/metrics/constants.js","../src/features/metrics/index.js","../src/features/metrics/aggregate/framework-detection.js","../src/features/metrics/aggregate/harvest-metadata.js","../src/features/metrics/aggregate/index.js","../src/features/metrics/instrument/index.js","../src/features/page_action/constants.js","../src/features/page_action/index.js","../src/features/page_action/instrument/index.js","../src/features/page_view_event/constants.js","../src/features/page_view_event/index.js","../src/features/page_view_event/aggregate/index.js","../src/features/page_view_event/aggregate/initialized-features.js","../src/features/page_view_event/instrument/index.js","../src/features/page_view_timing/constants.js","../src/features/page_view_timing/index.js","../src/features/page_view_timing/aggregate/index.js","../src/features/page_view_timing/instrument/index.js","../src/features/session_replay/constants.js","../src/features/session_replay/index.js","../src/features/session_replay/aggregate/index.js","../src/features/session_replay/instrument/index.js","../src/features/session_replay/shared/recorder-events.js","../src/features/session_replay/shared/recorder.js","../src/features/session_replay/shared/stylesheet-evaluator.js","../src/features/session_replay/shared/utils.js","../src/features/session_trace/constants.js","../src/features/session_trace/index.js","../src/features/session_trace/aggregate/index.js","../src/features/session_trace/aggregate/trace/node.js","../src/features/session_trace/aggregate/trace/storage.js","../src/features/session_trace/aggregate/trace/utils.js","../src/features/session_trace/instrument/index.js","../src/features/soft_navigations/constants.js","../src/features/soft_navigations/index.js","../src/features/soft_navigations/aggregate/ajax-node.js","../src/features/soft_navigations/aggregate/bel-node.js","../src/features/soft_navigations/aggregate/index.js","../src/features/soft_navigations/aggregate/initial-page-load-interaction.js","../src/features/soft_navigations/aggregate/interaction.js","../src/features/soft_navigations/instrument/index.js","../src/features/spa/constants.js","../src/features/spa/index.js","../src/features/spa/aggregate/index.js","../src/features/spa/aggregate/interaction-node.js","../src/features/spa/aggregate/interaction.js","../src/features/spa/aggregate/serializer.js","../src/features/spa/instrument/index.js","../src/features/utils/agent-session.js","../src/features/utils/aggregate-base.js","../src/features/utils/event-buffer.js","../src/features/utils/feature-base.js","../src/features/utils/feature-gates.js","../src/features/utils/instrument-base.js","../src/features/utils/nr1-debugger.js","../src/interfaces/registered-entity.js","../src/loaders/agent-base.js","../src/loaders/agent.js","../src/loaders/api-base.js","../src/loaders/browser-agent.js","../src/loaders/micro-agent-base.js","../src/loaders/micro-agent.js","../src/loaders/api/addPageAction.js","../src/loaders/api/addRelease.js","../src/loaders/api/addToTrace.js","../src/loaders/api/consent.js","../src/loaders/api/constants.js","../src/loaders/api/finished.js","../src/loaders/api/interaction-types.js","../src/loaders/api/interaction.js","../src/loaders/api/log.js","../src/loaders/api/measure.js","../src/loaders/api/noticeError.js","../src/loaders/api/pauseReplay.js","../src/loaders/api/recordCustomEvent.js","../src/loaders/api/recordReplay.js","../src/loaders/api/register-api-types.js","../src/loaders/api/register.js","../src/loaders/api/setApplicationVersion.js","../src/loaders/api/setCustomAttribute.js","../src/loaders/api/setErrorHandler.js","../src/loaders/api/setPageViewName.js","../src/loaders/api/setUserId.js","../src/loaders/api/sharedHandlers.js","../src/loaders/api/start.js","../src/loaders/api/topLevelCallers.js","../src/loaders/api/wrapLogger.js","../src/loaders/configure/configure.js","../src/loaders/configure/nonce.js","../src/loaders/configure/public-path.js","../src/loaders/features/enabled-features.js","../src/loaders/features/featureDependencies.js","../src/loaders/features/features.js"],"version":"5.9.3"}
1
+ {"root":["../src/index.js","../src/cdn/experimental.js","../src/cdn/lite.js","../src/cdn/pro.js","../src/cdn/spa.js","../src/common/aggregate/aggregator.js","../src/common/aggregate/event-aggregator.js","../src/common/config/configurable.js","../src/common/config/info.js","../src/common/config/init-types.js","../src/common/config/init.js","../src/common/config/loader-config.js","../src/common/config/runtime.js","../src/common/constants/agent-constants.js","../src/common/constants/env.cdn.js","../src/common/constants/env.js","../src/common/constants/env.npm.js","../src/common/constants/runtime.js","../src/common/constants/shared-channel.js","../src/common/deny-list/deny-list.js","../src/common/dispatch/global-event.js","../src/common/dom/iframe.js","../src/common/dom/query-selector.js","../src/common/dom/selector-path.js","../src/common/drain/drain.js","../src/common/event-emitter/contextual-ee.js","../src/common/event-emitter/event-context.js","../src/common/event-emitter/handle.js","../src/common/event-emitter/register-handler.js","../src/common/event-listener/event-listener-opts.js","../src/common/harvest/harvester.js","../src/common/harvest/types.js","../src/common/ids/bundle-id.js","../src/common/ids/id.js","../src/common/ids/unique-id.js","../src/common/serialize/bel-serializer.js","../src/common/session/constants.js","../src/common/session/session-entity.js","../src/common/storage/local-storage.js","../src/common/timer/interaction-timer.js","../src/common/timer/timer.js","../src/common/timing/nav-timing.js","../src/common/timing/now.js","../src/common/timing/time-keeper.js","../src/common/unload/eol.js","../src/common/url/canonicalize-url.js","../src/common/url/clean-url.js","../src/common/url/encode.js","../src/common/url/extract-url.js","../src/common/url/location.js","../src/common/url/parse-url.js","../src/common/url/protocol.js","../src/common/util/attribute-size.js","../src/common/util/console.js","../src/common/util/data-size.js","../src/common/util/event-origin.js","../src/common/util/feature-flags.js","../src/common/util/get-or-set.js","../src/common/util/invoke.js","../src/common/util/mfe.js","../src/common/util/monkey-patched.js","../src/common/util/obfuscate.js","../src/common/util/stringify.js","../src/common/util/submit-data.js","../src/common/util/text.js","../src/common/util/traverse.js","../src/common/util/type-check.js","../src/common/vitals/constants.js","../src/common/vitals/cumulative-layout-shift.js","../src/common/vitals/first-contentful-paint.js","../src/common/vitals/first-paint.js","../src/common/vitals/interaction-to-next-paint.js","../src/common/vitals/largest-contentful-paint.js","../src/common/vitals/load-time.js","../src/common/vitals/time-to-first-byte.js","../src/common/vitals/vital-metric.js","../src/common/window/load.js","../src/common/window/nreum.js","../src/common/window/page-visibility.js","../src/common/wrap/wrap-events.js","../src/common/wrap/wrap-fetch.js","../src/common/wrap/wrap-function.js","../src/common/wrap/wrap-history.js","../src/common/wrap/wrap-jsonp.js","../src/common/wrap/wrap-logger.js","../src/common/wrap/wrap-mutation.js","../src/common/wrap/wrap-promise.js","../src/common/wrap/wrap-timer.js","../src/common/wrap/wrap-websocket.js","../src/common/wrap/wrap-xhr.js","../src/features/ajax/constants.js","../src/features/ajax/index.js","../src/features/ajax/aggregate/gql.js","../src/features/ajax/aggregate/index.js","../src/features/ajax/instrument/distributed-tracing.js","../src/features/ajax/instrument/index.js","../src/features/ajax/instrument/response-size.js","../src/features/generic_events/constants.js","../src/features/generic_events/index.js","../src/features/generic_events/aggregate/index.js","../src/features/generic_events/aggregate/user-actions/aggregated-user-action.js","../src/features/generic_events/aggregate/user-actions/user-actions-aggregator.js","../src/features/generic_events/instrument/index.js","../src/features/jserrors/constants.js","../src/features/jserrors/index.js","../src/features/jserrors/aggregate/canonical-function-name.js","../src/features/jserrors/aggregate/cause-string.js","../src/features/jserrors/aggregate/compute-stack-trace.js","../src/features/jserrors/aggregate/format-stack-trace.js","../src/features/jserrors/aggregate/index.js","../src/features/jserrors/aggregate/internal-errors.js","../src/features/jserrors/aggregate/string-hash-code.js","../src/features/jserrors/instrument/index.js","../src/features/jserrors/shared/cast-error.js","../src/features/jserrors/shared/uncaught-error.js","../src/features/logging/constants.js","../src/features/logging/index.js","../src/features/logging/aggregate/index.js","../src/features/logging/instrument/index.js","../src/features/logging/shared/log.js","../src/features/logging/shared/utils.js","../src/features/metrics/constants.js","../src/features/metrics/index.js","../src/features/metrics/aggregate/framework-detection.js","../src/features/metrics/aggregate/harvest-metadata.js","../src/features/metrics/aggregate/index.js","../src/features/metrics/instrument/index.js","../src/features/page_action/constants.js","../src/features/page_action/index.js","../src/features/page_action/instrument/index.js","../src/features/page_view_event/constants.js","../src/features/page_view_event/index.js","../src/features/page_view_event/aggregate/index.js","../src/features/page_view_event/aggregate/initialized-features.js","../src/features/page_view_event/instrument/index.js","../src/features/page_view_timing/constants.js","../src/features/page_view_timing/index.js","../src/features/page_view_timing/aggregate/index.js","../src/features/page_view_timing/instrument/index.js","../src/features/session_replay/constants.js","../src/features/session_replay/index.js","../src/features/session_replay/aggregate/index.js","../src/features/session_replay/instrument/index.js","../src/features/session_replay/shared/recorder-events.js","../src/features/session_replay/shared/recorder.js","../src/features/session_replay/shared/stylesheet-evaluator.js","../src/features/session_replay/shared/utils.js","../src/features/session_trace/constants.js","../src/features/session_trace/index.js","../src/features/session_trace/aggregate/index.js","../src/features/session_trace/aggregate/trace/node.js","../src/features/session_trace/aggregate/trace/storage.js","../src/features/session_trace/aggregate/trace/utils.js","../src/features/session_trace/instrument/index.js","../src/features/soft_navigations/constants.js","../src/features/soft_navigations/index.js","../src/features/soft_navigations/aggregate/ajax-node.js","../src/features/soft_navigations/aggregate/bel-node.js","../src/features/soft_navigations/aggregate/index.js","../src/features/soft_navigations/aggregate/initial-page-load-interaction.js","../src/features/soft_navigations/aggregate/interaction.js","../src/features/soft_navigations/instrument/index.js","../src/features/spa/constants.js","../src/features/spa/index.js","../src/features/spa/aggregate/index.js","../src/features/spa/aggregate/interaction-node.js","../src/features/spa/aggregate/interaction.js","../src/features/spa/aggregate/serializer.js","../src/features/spa/instrument/index.js","../src/features/utils/agent-session.js","../src/features/utils/aggregate-base.js","../src/features/utils/event-buffer.js","../src/features/utils/feature-base.js","../src/features/utils/feature-gates.js","../src/features/utils/instrument-base.js","../src/features/utils/nr1-debugger.js","../src/interfaces/registered-entity.js","../src/loaders/agent-base.js","../src/loaders/agent.js","../src/loaders/api-base.js","../src/loaders/browser-agent.js","../src/loaders/micro-agent-base.js","../src/loaders/micro-agent.js","../src/loaders/api/addPageAction.js","../src/loaders/api/addRelease.js","../src/loaders/api/addToTrace.js","../src/loaders/api/consent.js","../src/loaders/api/constants.js","../src/loaders/api/finished.js","../src/loaders/api/interaction-types.js","../src/loaders/api/interaction.js","../src/loaders/api/log.js","../src/loaders/api/measure.js","../src/loaders/api/noticeError.js","../src/loaders/api/pauseReplay.js","../src/loaders/api/recordCustomEvent.js","../src/loaders/api/recordReplay.js","../src/loaders/api/register-api-types.js","../src/loaders/api/register.js","../src/loaders/api/setApplicationVersion.js","../src/loaders/api/setCustomAttribute.js","../src/loaders/api/setErrorHandler.js","../src/loaders/api/setPageViewName.js","../src/loaders/api/setUserId.js","../src/loaders/api/sharedHandlers.js","../src/loaders/api/start.js","../src/loaders/api/topLevelCallers.js","../src/loaders/api/wrapLogger.js","../src/loaders/configure/configure.js","../src/loaders/configure/nonce.js","../src/loaders/configure/public-path.js","../src/loaders/features/enabled-features.js","../src/loaders/features/featureDependencies.js","../src/loaders/features/features.js"],"version":"5.9.3"}
@@ -26,4 +26,5 @@ export const ffVersion: number;
26
26
  * @type {number}
27
27
  */
28
28
  export const originTime: number;
29
+ export function supportsNavTimingL2(): boolean;
29
30
  //# sourceMappingURL=runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/common/constants/runtime.js"],"names":[],"mappings":"AAcA;;GAEG;AACH,qCAEqB;AAErB;;GAEG;AACH,oCAeK;AAEL,oDAUI;AAEJ,oDAA6F;AAE7F,sCAA2F;AAE3F,qCAAyD;AAEzD,4BAA8E;AAE9E;;;;;;GAMG;AACH,iCAAwE;AAExE,+BAOI;AAEJ;;;;GAIG;AACH,yBAFU,MAAM,CAE4B"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/common/constants/runtime.js"],"names":[],"mappings":"AAcA;;GAEG;AACH,qCAEqB;AAErB;;GAEG;AACH,oCAeK;AAEL,oDAUI;AAEJ,oDAA6F;AAE7F,sCAA2F;AAE3F,qCAAyD;AAEzD,4BAA8E;AAE9E;;;;;;GAMG;AACH,iCAAwE;AAExE,+BAOI;AAEJ;;;;GAIG;AACH,yBAFU,MAAM,CAE4B;AAErC,+CAA4J"}
@@ -1 +1 @@
1
- {"version":3,"file":"nav-timing.d.ts","sourceRoot":"","sources":["../../../../src/common/timing/nav-timing.js"],"names":[],"mappings":"AAwCA,uFAyBC;AAGD,4CAIC;AA7CD,oCAAiC"}
1
+ {"version":3,"file":"nav-timing.d.ts","sourceRoot":"","sources":["../../../../src/common/timing/nav-timing.js"],"names":[],"mappings":"AAwCA,uFAyBC;AAGD,4CASC;AAlDD,oCAAiC"}
@@ -14,10 +14,7 @@ export function hasValidValue(val: any): boolean;
14
14
  *
15
15
  * @param {Object} [target] the registered target
16
16
  * @param {AggregateInstance} [aggregateInstance] the aggregate instance calling the method
17
- * @returns {{'mfe.id': *, 'mfe.name': String}|{}} returns an empty object if args are not supplied or the aggregate instance is not supporting version 2
17
+ * @returns {Object} returns an empty object if args are not supplied or the aggregate instance is not supporting version 2
18
18
  */
19
- export function getVersion2Attributes(target?: Object, aggregateInstance?: AggregateInstance): {
20
- "mfe.id": any;
21
- "mfe.name": string;
22
- } | {};
19
+ export function getVersion2Attributes(target?: Object, aggregateInstance?: AggregateInstance): Object;
23
20
  //# sourceMappingURL=mfe.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mfe.d.ts","sourceRoot":"","sources":["../../../../src/common/util/mfe.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,0CAHW,MAAM,GACJ,OAAO,CAInB;AAED,iDAEC;AAED;;;;;;;GAOG;AACH,+CAJW,MAAM,sBACN,iBAAiB,GACf;IAAC,QAAQ,EAAE,GAAC,CAAC;IAAC,UAAU,SAAQ;CAAC,GAAC,EAAE,CAiBhD"}
1
+ {"version":3,"file":"mfe.d.ts","sourceRoot":"","sources":["../../../../src/common/util/mfe.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,0CAHW,MAAM,GACJ,OAAO,CAInB;AAED,iDAEC;AAED;;;;;;;GAOG;AACH,+CAJW,MAAM,sBACN,iBAAiB,GACf,MAAM,CAiBlB"}
@@ -3,6 +3,7 @@ export namespace VITAL_NAMES {
3
3
  let FIRST_CONTENTFUL_PAINT: string;
4
4
  let FIRST_INTERACTION: string;
5
5
  let LARGEST_CONTENTFUL_PAINT: string;
6
+ let LOAD_TIME: string;
6
7
  let CUMULATIVE_LAYOUT_SHIFT: string;
7
8
  let INTERACTION_TO_NEXT_PAINT: string;
8
9
  let TIME_TO_FIRST_BYTE: string;
@@ -0,0 +1,3 @@
1
+ export const loadTime: VitalMetric;
2
+ import { VitalMetric } from './vital-metric';
3
+ //# sourceMappingURL=load-time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-time.d.ts","sourceRoot":"","sources":["../../../../src/common/vitals/load-time.js"],"names":[],"mappings":"AASA,mCAA8D;4BAFlC,gBAAgB"}
@@ -1,5 +1,14 @@
1
1
  export function checkState(): boolean;
2
- export function onWindowLoad(cb: any, useCapture: any): any;
2
+ /**
3
+ * Executes a callback when the window 'load' event fires, or immediately if the load event has already occurred.
4
+ * Sets up a backup polling mechanism in the rare case that the browser does not fire the load event when the page has loaded,
5
+ * such as in certain iframe scenarios like ChatGPT connector frames. Cannot use document.readystatechange event here because
6
+ * it blocks back/forward cache in Safari browsers.
7
+ * @param {Function} cb
8
+ * @param {boolean} [useCapture]
9
+ * @returns {void}
10
+ */
11
+ export function onWindowLoad(cb: Function, useCapture?: boolean): void;
3
12
  export function onDOMContentLoaded(cb: any): any;
4
13
  export function onPopstateChange(cb: any): any;
5
14
  //# sourceMappingURL=load.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../../src/common/window/load.js"],"names":[],"mappings":"AAMA,sCAEC;AAED,4DAGC;AAED,iDAGC;AAED,+CAGC"}
1
+ {"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../../src/common/window/load.js"],"names":[],"mappings":"AAOA,sCAEC;AAED;;;;;;;;GAQG;AACH,wDAHW,OAAO,GACL,IAAI,CAYhB;AAED,iDAGC;AAED,+CAGC"}
@@ -1,5 +1,4 @@
1
1
  export class UserActionsAggregator {
2
- constructor(userFrustrationsEnabled: any);
3
2
  get aggregationEvent(): AggregatedUserAction | undefined;
4
3
  /**
5
4
  * Process the event and determine if a new aggregation set should be made or if it should increment the current aggregation
@@ -1 +1 @@
1
- {"version":3,"file":"user-actions-aggregator.d.ts","sourceRoot":"","sources":["../../../../../../src/features/generic_events/aggregate/user-actions/user-actions-aggregator.js"],"names":[],"mappings":"AAUA;IASE,0CAKC;IAED,yDAQC;IAED;;;;OAIG;IACH,aAHW,KAAK,sBACH,oBAAoB,GAAC,SAAS,CA6B1C;IAED,yBAKC;IA0CD,oBAEC;;CACF;qCAlHoC,0BAA0B"}
1
+ {"version":3,"file":"user-actions-aggregator.d.ts","sourceRoot":"","sources":["../../../../../../src/features/generic_events/aggregate/user-actions/user-actions-aggregator.js"],"names":[],"mappings":"AAUA;IAcE,yDAQC;IAED;;;;OAIG;IACH,aAHW,KAAK,sBACH,oBAAoB,GAAC,SAAS,CA2B1C;IAED,yBAKC;IA0CD,oBAEC;;CACF;qCA9GoC,0BAA0B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/generic_events/instrument/index.js"],"names":[],"mappings":"AAwBA;IACE,2BAAiC;IACjC,2BAyGC;IAXG,2CAA0C;IAG5C,yBAGC;CAMJ;AAED,8CAAuC;+BAxHR,6BAA6B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/generic_events/instrument/index.js"],"names":[],"mappings":"AAwBA;IACE,2BAAiC;IACjC,2BAuGC;IAXG,2CAA0C;IAG5C,yBAGC;CAMJ;AAED,8CAAuC;+BAtHR,6BAA6B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_event/aggregate/index.js"],"names":[],"mappings":"AAuBA;IACE,2BAA2C;IAE3C,2BA6BC;IA1BC,iBAAoB;IAEpB,wBAAwB;IACxB,8BAA8B;IAC9B,8BAA8B;IAC9B,gBAAgB;IAuBlB;;;;OAIG;IACH,2BAFW,GAAC,QAoEX;IAbC;;;;;;;;;;;;;;mBAOC;IANC,iCAAyB;IAc7B,kCAEC;IAED;;;;;;aAiGC;CACF;8BA5N6B,4BAA4B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_event/aggregate/index.js"],"names":[],"mappings":"AAuBA;IACE,2BAA2C;IAE3C,2BA4BC;IAzBC,iBAAoB;IAEpB,wBAAwB;IACxB,8BAA8B;IAC9B,8BAA8B;IAC9B,gBAAgB;IAsBlB;;;;OAIG;IACH,2BAFW,GAAC,QAoEX;IAbC;;;;;;;;;;;;;;mBAOC;IANC,iCAAyB;IAc7B,kCAEC;IAED;;;;;;aAiGC;CACF;8BA3N6B,4BAA4B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_timing/aggregate/index.js"],"names":[],"mappings":"AAsBA;IACE,2BAAiC;IAMjC,2BA8BC;IA5BC,4BAA+B;IAC/B,0BAA6B;IA6B/B;;;OAGG;IACH,6BAFW,MAAM,QAOhB;IAED;;;;MA6BC;IAED;;;OAGG;IACH,4BAFa,IAAI,CAahB;IAED,gDAUC;IAED,4BAGC;IAGD,qCAwBC;;CACF;8BAzJ6B,4BAA4B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_timing/aggregate/index.js"],"names":[],"mappings":"AAsBA;IACE,2BAAiC;IAMjC,2BA4BC;IA1BC,4BAA+B;IAC/B,0BAA6B;IA2B/B;;;OAGG;IACH,6BAFW,MAAM,QAOhB;IAED;;;;MA6BC;IAED;;;OAGG;IACH,4BAFa,IAAI,CAahB;IAED,gDAUC;IAED,4BAGC;IAGD,qCAwBC;;CACF;8BAvJ6B,4BAA4B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/aggregate/index.js"],"names":[],"mappings":"AAeA;IACE,2BAAiC;IACjC;;OAgEC;IA3DC,2BAAwC;IACxC,iBAA8B;IAE9B,uDAA0E;IAe1E,yBAA+B;IAC/B,0CAAiC;IACjC,yBAA4C;IAyC9C,qCAUC;IAED,0EAmBC;IAED,2BAiBC;IAED;;;;;;;OAOG;IACH,6BAHW,mBAAmB,OAsB7B;;CAwGF;8BAjQ6B,4BAA4B;2CAGf,iCAAiC;4BAChD,eAAe"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/aggregate/index.js"],"names":[],"mappings":"AAeA;IACE,2BAAiC;IACjC;;OA+DC;IA1DC,2BAAwC;IACxC,iBAA8B;IAE9B,uDAA0E;IAc1E,yBAA+B;IAC/B,0CAAiC;IACjC,yBAA4C;IAyC9C,qCAUC;IAED,0EAmBC;IAED,2BAiBC;IAED;;;;;;;OAOG;IACH,6BAHW,mBAAmB,OAsB7B;;CAwGF;8BAhQ6B,4BAA4B;2CAGf,iCAAiC;4BAChD,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/spa/instrument/index.js"],"names":[],"mappings":"AAuBA;;GAEG;AACH;IACE,2BAAiC;IACjC,2BA0FC;IAjFG,2CAA0C;;CAwF/C;AAED,oCAA6B;+BA1HE,6BAA6B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/spa/instrument/index.js"],"names":[],"mappings":"AAwBA;;GAEG;AACH;IACE,2BAAiC;IACjC,2BA+FC;IAtFG,2CAA0C;;CA6F/C;AAED,oCAA6B;+BAhIE,6BAA6B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.304.0",
3
+ "version": "1.305.0",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -83,3 +83,5 @@ export const ffVersion = (() => {
83
83
  * @type {number}
84
84
  */
85
85
  export const originTime = Date.now() - now()
86
+
87
+ export const supportsNavTimingL2 = () => typeof PerformanceNavigationTiming !== 'undefined' && globalScope?.performance?.getEntriesByType('navigation')?.length > 0
@@ -67,8 +67,13 @@ export function addPT (offset, pt, v = {}, isL1Api = false) {
67
67
 
68
68
  // Add Performance Navigation values to the given object
69
69
  export function addPN (pn, v) {
70
- handleValue(getPntType(pn.type), v, 'ty')
71
- handleValue(pn.redirectCount, v, 'rc')
70
+ try {
71
+ handleValue(getPntType(pn.type), v, 'ty')
72
+ handleValue(pn.redirectCount, v, 'rc')
73
+ } catch (e) {
74
+ v.ty = 0
75
+ v.rc = 0
76
+ }
72
77
  return v
73
78
  }
74
79
 
@@ -21,7 +21,7 @@ export function hasValidValue (val) {
21
21
  *
22
22
  * @param {Object} [target] the registered target
23
23
  * @param {AggregateInstance} [aggregateInstance] the aggregate instance calling the method
24
- * @returns {{'mfe.id': *, 'mfe.name': String}|{}} returns an empty object if args are not supplied or the aggregate instance is not supporting version 2
24
+ * @returns {Object} returns an empty object if args are not supplied or the aggregate instance is not supporting version 2
25
25
  */
26
26
  export function getVersion2Attributes (target, aggregateInstance) {
27
27
  if (aggregateInstance?.harvestEndpointVersion !== 2) return {}
@@ -33,9 +33,9 @@ export function getVersion2Attributes (target, aggregateInstance) {
33
33
  }
34
34
  }
35
35
  return {
36
- 'mfe.id': target.id,
37
- 'mfe.name': target.name,
38
- eventSource: target.eventSource,
36
+ 'source.id': target.id,
37
+ 'source.name': target.name,
38
+ 'source.type': target.type,
39
39
  'parent.id': target.parent?.id || containerAgentEntityGuid
40
40
  }
41
41
  }
@@ -7,6 +7,7 @@ export const VITAL_NAMES = {
7
7
  FIRST_CONTENTFUL_PAINT: 'fcp',
8
8
  FIRST_INTERACTION: 'fi',
9
9
  LARGEST_CONTENTFUL_PAINT: 'lcp',
10
+ LOAD_TIME: 'load',
10
11
  CUMULATIVE_LAYOUT_SHIFT: 'cls',
11
12
  INTERACTION_TO_NEXT_PAINT: 'inp',
12
13
  TIME_TO_FIRST_BYTE: 'ttfb'
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright 2020-2025 New Relic, Inc. All rights reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { globalScope, isBrowserScope, originTime, supportsNavTimingL2 } from '../constants/runtime'
6
+ import { onWindowLoad } from '../window/load'
7
+ import { VITAL_NAMES } from './constants'
8
+ import { VitalMetric } from './vital-metric'
9
+
10
+ export const loadTime = new VitalMetric(VITAL_NAMES.LOAD_TIME)
11
+
12
+ if (isBrowserScope) {
13
+ const perf = globalScope.performance
14
+ const handler = () => {
15
+ if (!loadTime.isValid && perf) {
16
+ loadTime.update({
17
+ value: supportsNavTimingL2() ? perf.getEntriesByType('navigation')?.[0]?.loadEventEnd : perf.timing?.loadEventEnd - originTime
18
+ })
19
+ }
20
+ }
21
+
22
+ onWindowLoad(handler, true)
23
+ }
@@ -2,7 +2,7 @@
2
2
  * Copyright 2020-2025 New Relic, Inc. All rights reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- import { globalScope, isBrowserScope, isiOS, originTime } from '../constants/runtime'
5
+ import { globalScope, isBrowserScope, isiOS, originTime, supportsNavTimingL2 } from '../constants/runtime'
6
6
  import { VITAL_NAMES } from './constants'
7
7
  import { VitalMetric } from './vital-metric'
8
8
  import { onTTFB } from 'web-vitals/attribution'
@@ -16,7 +16,7 @@ export const timeToFirstByte = new VitalMetric(VITAL_NAMES.TIME_TO_FIRST_BYTE)
16
16
  * - in an iOS browser
17
17
  * - cross-origin iframes specifically in firefox and safari
18
18
  */
19
- if (isBrowserScope && typeof PerformanceNavigationTiming !== 'undefined' && !isiOS && window === window.parent) {
19
+ if (isBrowserScope && supportsNavTimingL2() && !isiOS && window === window.parent) {
20
20
  onTTFB(({ value, attribution }) => {
21
21
  if (timeToFirstByte.isValid) return
22
22
  timeToFirstByte.update({ value, attrs: { navigationEntry: attribution.navigationEntry } })