@newrelic/browser-agent 1.320.1-rc.4 → 1.320.1-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/features/session_replay/shared/utils.js +3 -5
- package/dist/cjs/loaders/api/register.js +18 -5
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/features/session_replay/shared/utils.js +3 -5
- package/dist/esm/loaders/api/register.js +18 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/features/session_replay/shared/utils.d.ts.map +1 -1
- package/dist/types/loaders/api/register.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/features/session_replay/shared/utils.js +3 -5
- package/src/loaders/api/register.js +15 -5
- package/dist/cjs/common/url/location.js +0 -18
- package/dist/esm/common/url/location.js +0 -12
- package/dist/types/common/url/location.d.ts +0 -10
- package/dist/types/common/url/location.d.ts.map +0 -1
- package/src/common/url/__mocks__/location.js +0 -5
- package/src/common/url/location.js +0 -12
|
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.RRWEB_PACKAGE_NAME = exports.D
|
|
|
17
17
|
/**
|
|
18
18
|
* Exposes the version of the agent
|
|
19
19
|
*/
|
|
20
|
-
const VERSION = exports.VERSION = "1.320.1-rc.
|
|
20
|
+
const VERSION = exports.VERSION = "1.320.1-rc.6";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Exposes the build type of the agent
|
|
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.RRWEB_PACKAGE_NAME = exports.D
|
|
|
17
17
|
/**
|
|
18
18
|
* Exposes the version of the agent
|
|
19
19
|
*/
|
|
20
|
-
const VERSION = exports.VERSION = "1.320.1-rc.
|
|
20
|
+
const VERSION = exports.VERSION = "1.320.1-rc.6";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Exposes the build type of the agent
|
|
@@ -9,7 +9,7 @@ exports.isPreloadAllowed = isPreloadAllowed;
|
|
|
9
9
|
var _nreum = require("../../../common/window/nreum");
|
|
10
10
|
var _featureGates = require("../../utils/feature-gates");
|
|
11
11
|
/**
|
|
12
|
-
* Copyright 2020-
|
|
12
|
+
* Copyright 2020-2026 New Relic, Inc. All rights reserved.
|
|
13
13
|
* SPDX-License-Identifier: Apache-2.0
|
|
14
14
|
*/
|
|
15
15
|
|
|
@@ -25,10 +25,8 @@ function isPreloadAllowed(agentInit) {
|
|
|
25
25
|
}
|
|
26
26
|
function customMasker(text, element) {
|
|
27
27
|
try {
|
|
28
|
-
if (typeof element?.type === 'string')
|
|
29
|
-
|
|
30
|
-
if (element?.dataset?.nrUnmask !== undefined || element?.classList?.contains('nr-unmask')) return text;
|
|
31
|
-
}
|
|
28
|
+
if (typeof element?.type === 'string' && element.type.toLowerCase() === 'password') return '*'.repeat(text?.length || 0);
|
|
29
|
+
if (element?.dataset?.nrUnmask !== undefined || element?.classList?.contains('nr-unmask')) return text;
|
|
32
30
|
} catch (err) {
|
|
33
31
|
// likely an element was passed to this handler that was invalid and was missing attributes or methods
|
|
34
32
|
}
|
|
@@ -23,6 +23,7 @@ var _pageVisibility = require("../../common/window/page-visibility");
|
|
|
23
23
|
var _scriptTracker = require("../../common/v2/script-tracker");
|
|
24
24
|
var _mfeVitals = require("../../common/v2/mfe-vitals");
|
|
25
25
|
var _uniqueId = require("../../common/ids/unique-id");
|
|
26
|
+
var _cleanUrl = require("../../common/url/clean-url");
|
|
26
27
|
/**
|
|
27
28
|
* Copyright 2020-2026 New Relic, Inc. All rights reserved.
|
|
28
29
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -84,10 +85,15 @@ function register(agentRef, target) {
|
|
|
84
85
|
// getter because this is asynchronously set
|
|
85
86
|
type: _constants.V2_TYPES.BA
|
|
86
87
|
};
|
|
88
|
+
|
|
89
|
+
// The script timings for this entity, which will be used to populate part of the MicroFrontEndTiming custom event.
|
|
87
90
|
const timings = (0, _scriptTracker.findScriptTimings)(target);
|
|
88
91
|
|
|
89
|
-
// Track MFE vitals for this entity
|
|
92
|
+
// Track MFE vitals for this entity, which will be used to populate part of the MicroFrontEndTiming custom event.
|
|
90
93
|
const vitals = (0, _mfeVitals.trackMFEVitals)(target, timings);
|
|
94
|
+
|
|
95
|
+
// the URL of the page at the time this entity was registered, which will be used to populate part of the MicroFrontEndTiming custom event.
|
|
96
|
+
const registerUrl = (0, _cleanUrl.cleanURL)('' + location);
|
|
91
97
|
const attrs = {};
|
|
92
98
|
|
|
93
99
|
// Only define attributes getter if it doesn't already exist
|
|
@@ -223,6 +229,13 @@ function register(agentRef, target) {
|
|
|
223
229
|
// the url of the script that was registered, or undefined if it could not be determined (inline or no match)
|
|
224
230
|
assetType: timings.type,
|
|
225
231
|
// the type of asset that was associated with the timings, one of 'script', 'link' (if preloaded and found in the resource timing buffer), 'preload' (if preloaded but not found in the resource timing buffer), or "unknown" if it could not be determined
|
|
232
|
+
registerUrl,
|
|
233
|
+
// the url of the page at the time this entity was registered
|
|
234
|
+
deregisterUrl: (0, _cleanUrl.cleanURL)('' + location),
|
|
235
|
+
// the url of the page at the time this entity was deregistered (or unloaded)
|
|
236
|
+
// generic_events' addEvent() injects pageUrl/currentUrl on every custom event by default; override them away here in favor of registerUrl/deregisterUrl above
|
|
237
|
+
pageUrl: undefined,
|
|
238
|
+
currentUrl: undefined,
|
|
226
239
|
timeAlive: timings.reportedAt - timings.registeredAt,
|
|
227
240
|
// registeredAt to reportedAt
|
|
228
241
|
timeToBeRequested: timings.fetchStart,
|
|
@@ -237,19 +250,19 @@ function register(agentRef, target) {
|
|
|
237
250
|
// timestamp when register() was called
|
|
238
251
|
// leave room to extend these with more data keys as needed
|
|
239
252
|
...(vitals.fcp.value >= 0 && {
|
|
240
|
-
'
|
|
253
|
+
'vitals.fcp.value': vitals.fcp.value
|
|
241
254
|
}),
|
|
242
255
|
// FCP vital object with value and metadata
|
|
243
256
|
...(vitals.lcp.value >= 0 && {
|
|
244
|
-
'
|
|
257
|
+
'vitals.lcp.value': vitals.lcp.value
|
|
245
258
|
}),
|
|
246
259
|
// LCP vital object with value and metadata
|
|
247
260
|
...(vitals.cls.value >= 0 && {
|
|
248
|
-
'
|
|
261
|
+
'vitals.cls.value': vitals.cls.value
|
|
249
262
|
}),
|
|
250
263
|
// CLS vital object with value and metadata
|
|
251
264
|
...(vitals.inp.value >= 0 && {
|
|
252
|
-
'
|
|
265
|
+
'vitals.inp.value': vitals.inp.value
|
|
253
266
|
}) // INP vital object with value and metadata
|
|
254
267
|
};
|
|
255
268
|
api.recordCustomEvent('MicroFrontEndTiming', eventData);
|
|
@@ -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
|
import { gosNREUMOriginals } from '../../../common/window/nreum';
|
|
@@ -16,10 +16,8 @@ export function isPreloadAllowed(agentInit) {
|
|
|
16
16
|
}
|
|
17
17
|
export function customMasker(text, element) {
|
|
18
18
|
try {
|
|
19
|
-
if (typeof element?.type === 'string')
|
|
20
|
-
|
|
21
|
-
if (element?.dataset?.nrUnmask !== undefined || element?.classList?.contains('nr-unmask')) return text;
|
|
22
|
-
}
|
|
19
|
+
if (typeof element?.type === 'string' && element.type.toLowerCase() === 'password') return '*'.repeat(text?.length || 0);
|
|
20
|
+
if (element?.dataset?.nrUnmask !== undefined || element?.classList?.contains('nr-unmask')) return text;
|
|
23
21
|
} catch (err) {
|
|
24
22
|
// likely an element was passed to this handler that was invalid and was missing attributes or methods
|
|
25
23
|
}
|
|
@@ -20,6 +20,7 @@ import { subscribeToPageUnload } from '../../common/window/page-visibility';
|
|
|
20
20
|
import { findScriptTimings } from '../../common/v2/script-tracker';
|
|
21
21
|
import { trackMFEVitals } from '../../common/v2/mfe-vitals';
|
|
22
22
|
import { generateRandomHexString } from '../../common/ids/unique-id';
|
|
23
|
+
import { cleanURL } from '../../common/url/clean-url';
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* @typedef {import('./register-api-types').RegisterAPI} RegisterAPI
|
|
@@ -77,10 +78,15 @@ function register(agentRef, target) {
|
|
|
77
78
|
// getter because this is asynchronously set
|
|
78
79
|
type: V2_TYPES.BA
|
|
79
80
|
};
|
|
81
|
+
|
|
82
|
+
// The script timings for this entity, which will be used to populate part of the MicroFrontEndTiming custom event.
|
|
80
83
|
const timings = findScriptTimings(target);
|
|
81
84
|
|
|
82
|
-
// Track MFE vitals for this entity
|
|
85
|
+
// Track MFE vitals for this entity, which will be used to populate part of the MicroFrontEndTiming custom event.
|
|
83
86
|
const vitals = trackMFEVitals(target, timings);
|
|
87
|
+
|
|
88
|
+
// the URL of the page at the time this entity was registered, which will be used to populate part of the MicroFrontEndTiming custom event.
|
|
89
|
+
const registerUrl = cleanURL('' + location);
|
|
84
90
|
const attrs = {};
|
|
85
91
|
|
|
86
92
|
// Only define attributes getter if it doesn't already exist
|
|
@@ -216,6 +222,13 @@ function register(agentRef, target) {
|
|
|
216
222
|
// the url of the script that was registered, or undefined if it could not be determined (inline or no match)
|
|
217
223
|
assetType: timings.type,
|
|
218
224
|
// the type of asset that was associated with the timings, one of 'script', 'link' (if preloaded and found in the resource timing buffer), 'preload' (if preloaded but not found in the resource timing buffer), or "unknown" if it could not be determined
|
|
225
|
+
registerUrl,
|
|
226
|
+
// the url of the page at the time this entity was registered
|
|
227
|
+
deregisterUrl: cleanURL('' + location),
|
|
228
|
+
// the url of the page at the time this entity was deregistered (or unloaded)
|
|
229
|
+
// generic_events' addEvent() injects pageUrl/currentUrl on every custom event by default; override them away here in favor of registerUrl/deregisterUrl above
|
|
230
|
+
pageUrl: undefined,
|
|
231
|
+
currentUrl: undefined,
|
|
219
232
|
timeAlive: timings.reportedAt - timings.registeredAt,
|
|
220
233
|
// registeredAt to reportedAt
|
|
221
234
|
timeToBeRequested: timings.fetchStart,
|
|
@@ -230,19 +243,19 @@ function register(agentRef, target) {
|
|
|
230
243
|
// timestamp when register() was called
|
|
231
244
|
// leave room to extend these with more data keys as needed
|
|
232
245
|
...(vitals.fcp.value >= 0 && {
|
|
233
|
-
'
|
|
246
|
+
'vitals.fcp.value': vitals.fcp.value
|
|
234
247
|
}),
|
|
235
248
|
// FCP vital object with value and metadata
|
|
236
249
|
...(vitals.lcp.value >= 0 && {
|
|
237
|
-
'
|
|
250
|
+
'vitals.lcp.value': vitals.lcp.value
|
|
238
251
|
}),
|
|
239
252
|
// LCP vital object with value and metadata
|
|
240
253
|
...(vitals.cls.value >= 0 && {
|
|
241
|
-
'
|
|
254
|
+
'vitals.cls.value': vitals.cls.value
|
|
242
255
|
}),
|
|
243
256
|
// CLS vital object with value and metadata
|
|
244
257
|
...(vitals.inp.value >= 0 && {
|
|
245
|
-
'
|
|
258
|
+
'vitals.inp.value': vitals.inp.value
|
|
246
259
|
}) // INP vital object with value and metadata
|
|
247
260
|
};
|
|
248
261
|
api.recordCustomEvent('MicroFrontEndTiming', eventData);
|
|
@@ -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/events.js","../src/common/constants/iframe-constants.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/connector.js","../src/common/harvest/harvester.js","../src/common/harvest/send.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/payloads/payloads.js","../src/common/serialize/bel-serializer.js","../src/common/session/constants.js","../src/common/session/session-entity.js","../src/common/session/session-key.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/add-url.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/
|
|
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/events.js","../src/common/constants/iframe-constants.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/connector.js","../src/common/harvest/harvester.js","../src/common/harvest/send.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/payloads/payloads.js","../src/common/serialize/bel-serializer.js","../src/common/session/constants.js","../src/common/session/session-entity.js","../src/common/session/session-key.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/add-url.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/parse-url.js","../src/common/url/protocol.js","../src/common/util/attribute-size.js","../src/common/util/browser-stack-matchers.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/monkey-patched.js","../src/common/util/obfuscate.js","../src/common/util/short-circuit.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/util/webdriver-detection.js","../src/common/v2/constants.js","../src/common/v2/mfe-vitals.js","../src/common/v2/script-correlation.js","../src/common/v2/script-tracker-constants.js","../src/common/v2/script-tracker.js","../src/common/v2/timing-factory.js","../src/common/v2/utils.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-logger.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/aggregate_v2/index.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/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/interfaces/registered-entity.js","../src/interfaces/registered-iframe-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/iframe-message-handler.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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/shared/utils.js"],"names":[],"mappings":"AAOA,+DAIC;AAED,0DAEC;AAED,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/shared/utils.js"],"names":[],"mappings":"AAOA,+DAIC;AAED,0DAEC;AAED,2DAQC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/register.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/register.js"],"names":[],"mappings":"AAqDA;;;;GAIG;AACH,mDAIC;;;;;;;0BArCY,OAAO,sBAAsB,EAAE,WAAW"}
|
package/package.json
CHANGED
|
@@ -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
|
import { gosNREUMOriginals } from '../../../common/window/nreum'
|
|
@@ -17,10 +17,8 @@ export function isPreloadAllowed (agentInit) {
|
|
|
17
17
|
|
|
18
18
|
export function customMasker (text, element) {
|
|
19
19
|
try {
|
|
20
|
-
if (typeof element?.type === 'string')
|
|
21
|
-
|
|
22
|
-
if (element?.dataset?.nrUnmask !== undefined || element?.classList?.contains('nr-unmask')) return text
|
|
23
|
-
}
|
|
20
|
+
if (typeof element?.type === 'string' && element.type.toLowerCase() === 'password') return '*'.repeat(text?.length || 0)
|
|
21
|
+
if (element?.dataset?.nrUnmask !== undefined || element?.classList?.contains('nr-unmask')) return text
|
|
24
22
|
} catch (err) {
|
|
25
23
|
// likely an element was passed to this handler that was invalid and was missing attributes or methods
|
|
26
24
|
}
|
|
@@ -20,6 +20,7 @@ import { subscribeToPageUnload } from '../../common/window/page-visibility'
|
|
|
20
20
|
import { findScriptTimings } from '../../common/v2/script-tracker'
|
|
21
21
|
import { trackMFEVitals } from '../../common/v2/mfe-vitals'
|
|
22
22
|
import { generateRandomHexString } from '../../common/ids/unique-id'
|
|
23
|
+
import { cleanURL } from '../../common/url/clean-url'
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* @typedef {import('./register-api-types').RegisterAPI} RegisterAPI
|
|
@@ -82,11 +83,15 @@ function register (agentRef, target) {
|
|
|
82
83
|
type: V2_TYPES.BA
|
|
83
84
|
}
|
|
84
85
|
|
|
86
|
+
// The script timings for this entity, which will be used to populate part of the MicroFrontEndTiming custom event.
|
|
85
87
|
const timings = findScriptTimings(target)
|
|
86
88
|
|
|
87
|
-
// Track MFE vitals for this entity
|
|
89
|
+
// Track MFE vitals for this entity, which will be used to populate part of the MicroFrontEndTiming custom event.
|
|
88
90
|
const vitals = trackMFEVitals(target, timings)
|
|
89
91
|
|
|
92
|
+
// the URL of the page at the time this entity was registered, which will be used to populate part of the MicroFrontEndTiming custom event.
|
|
93
|
+
const registerUrl = cleanURL('' + location)
|
|
94
|
+
|
|
90
95
|
const attrs = {}
|
|
91
96
|
|
|
92
97
|
// Only define attributes getter if it doesn't already exist
|
|
@@ -199,6 +204,11 @@ function register (agentRef, target) {
|
|
|
199
204
|
const eventData = {
|
|
200
205
|
assetUrl: timings.asset, // the url of the script that was registered, or undefined if it could not be determined (inline or no match)
|
|
201
206
|
assetType: timings.type, // the type of asset that was associated with the timings, one of 'script', 'link' (if preloaded and found in the resource timing buffer), 'preload' (if preloaded but not found in the resource timing buffer), or "unknown" if it could not be determined
|
|
207
|
+
registerUrl, // the url of the page at the time this entity was registered
|
|
208
|
+
deregisterUrl: cleanURL('' + location), // the url of the page at the time this entity was deregistered (or unloaded)
|
|
209
|
+
// generic_events' addEvent() injects pageUrl/currentUrl on every custom event by default; override them away here in favor of registerUrl/deregisterUrl above
|
|
210
|
+
pageUrl: undefined,
|
|
211
|
+
currentUrl: undefined,
|
|
202
212
|
timeAlive: timings.reportedAt - timings.registeredAt, // registeredAt to reportedAt
|
|
203
213
|
timeToBeRequested: timings.fetchStart, // origin to fetchStart
|
|
204
214
|
timeToExecute, // scriptStart to scriptEnd
|
|
@@ -206,10 +216,10 @@ function register (agentRef, target) {
|
|
|
206
216
|
timeToLoad: timeToFetch + timeToExecute, // fetch time and script time together
|
|
207
217
|
timeToRegister: timings.registeredAt, // timestamp when register() was called
|
|
208
218
|
// leave room to extend these with more data keys as needed
|
|
209
|
-
...(vitals.fcp.value >= 0 && { '
|
|
210
|
-
...(vitals.lcp.value >= 0 && { '
|
|
211
|
-
...(vitals.cls.value >= 0 && { '
|
|
212
|
-
...(vitals.inp.value >= 0 && { '
|
|
219
|
+
...(vitals.fcp.value >= 0 && { 'vitals.fcp.value': vitals.fcp.value }), // FCP vital object with value and metadata
|
|
220
|
+
...(vitals.lcp.value >= 0 && { 'vitals.lcp.value': vitals.lcp.value }), // LCP vital object with value and metadata
|
|
221
|
+
...(vitals.cls.value >= 0 && { 'vitals.cls.value': vitals.cls.value }), // CLS vital object with value and metadata
|
|
222
|
+
...(vitals.inp.value >= 0 && { 'vitals.inp.value': vitals.inp.value }) // INP vital object with value and metadata
|
|
213
223
|
}
|
|
214
224
|
|
|
215
225
|
api.recordCustomEvent('MicroFrontEndTiming', eventData)
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getLocation = getLocation;
|
|
7
|
-
/**
|
|
8
|
-
* Copyright 2020-2025 New Relic, Inc. All rights reserved.
|
|
9
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This method only exists to support testing in JIL and can be removed once tests are migrated to WDIO.
|
|
14
|
-
* @returns global scope location
|
|
15
|
-
*/
|
|
16
|
-
function getLocation() {
|
|
17
|
-
return '' + location;
|
|
18
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2020-2025 New Relic, Inc. All rights reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* This method only exists to support testing in JIL and can be removed once tests are migrated to WDIO.
|
|
8
|
-
* @returns global scope location
|
|
9
|
-
*/
|
|
10
|
-
export function getLocation() {
|
|
11
|
-
return '' + location;
|
|
12
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2020-2025 New Relic, Inc. All rights reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* This method only exists to support testing in JIL and can be removed once tests are migrated to WDIO.
|
|
7
|
-
* @returns global scope location
|
|
8
|
-
*/
|
|
9
|
-
export function getLocation(): string;
|
|
10
|
-
//# sourceMappingURL=location.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../../../src/common/url/location.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,sCAEC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2020-2025 New Relic, Inc. All rights reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* This method only exists to support testing in JIL and can be removed once tests are migrated to WDIO.
|
|
8
|
-
* @returns global scope location
|
|
9
|
-
*/
|
|
10
|
-
export function getLocation () {
|
|
11
|
-
return '' + location
|
|
12
|
-
}
|