@newrelic/browser-agent 1.298.0 → 1.299.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +12 -2
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/dom/selector-path.js +60 -44
- package/dist/cjs/common/harvest/harvester.js +37 -7
- package/dist/cjs/common/url/extract-url.js +21 -0
- package/dist/cjs/features/ajax/instrument/index.js +2 -9
- package/dist/cjs/features/generic_events/aggregate/index.js +29 -8
- package/dist/cjs/features/generic_events/aggregate/user-actions/aggregated-user-action.js +5 -3
- package/dist/cjs/features/generic_events/aggregate/user-actions/user-actions-aggregator.js +71 -33
- package/dist/cjs/features/generic_events/constants.js +2 -1
- package/dist/cjs/features/generic_events/instrument/index.js +45 -0
- package/dist/cjs/features/metrics/aggregate/framework-detection.js +2 -0
- package/dist/cjs/features/metrics/aggregate/harvest-metadata.js +45 -0
- package/dist/cjs/features/metrics/aggregate/index.js +21 -0
- package/dist/cjs/features/session_replay/aggregate/index.js +1 -1
- package/dist/cjs/features/session_replay/shared/recorder.js +6 -2
- package/dist/cjs/loaders/api/noticeError.js +1 -0
- package/dist/cjs/loaders/configure/configure.js +1 -0
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/dom/selector-path.js +58 -42
- package/dist/esm/common/harvest/harvester.js +37 -7
- package/dist/esm/common/url/extract-url.js +15 -0
- package/dist/esm/features/ajax/instrument/index.js +2 -9
- package/dist/esm/features/generic_events/aggregate/index.js +29 -8
- package/dist/esm/features/generic_events/aggregate/user-actions/aggregated-user-action.js +5 -3
- package/dist/esm/features/generic_events/aggregate/user-actions/user-actions-aggregator.js +72 -34
- package/dist/esm/features/generic_events/constants.js +1 -0
- package/dist/esm/features/generic_events/instrument/index.js +46 -1
- package/dist/esm/features/metrics/aggregate/framework-detection.js +2 -0
- package/dist/esm/features/metrics/aggregate/harvest-metadata.js +39 -0
- package/dist/esm/features/metrics/aggregate/index.js +21 -0
- package/dist/esm/features/session_replay/aggregate/index.js +1 -1
- package/dist/esm/features/session_replay/shared/recorder.js +6 -2
- package/dist/esm/loaders/api/noticeError.js +1 -0
- package/dist/esm/loaders/configure/configure.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/common/dom/selector-path.d.ts +6 -1
- package/dist/types/common/dom/selector-path.d.ts.map +1 -1
- package/dist/types/common/harvest/harvester.d.ts.map +1 -1
- package/dist/types/common/url/extract-url.d.ts +7 -0
- package/dist/types/common/url/extract-url.d.ts.map +1 -0
- package/dist/types/features/ajax/instrument/index.d.ts.map +1 -1
- package/dist/types/features/generic_events/aggregate/index.d.ts +1 -3
- package/dist/types/features/generic_events/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/generic_events/aggregate/user-actions/aggregated-user-action.d.ts +3 -1
- package/dist/types/features/generic_events/aggregate/user-actions/aggregated-user-action.d.ts.map +1 -1
- package/dist/types/features/generic_events/aggregate/user-actions/user-actions-aggregator.d.ts +3 -0
- package/dist/types/features/generic_events/aggregate/user-actions/user-actions-aggregator.d.ts.map +1 -1
- package/dist/types/features/generic_events/constants.d.ts +1 -0
- package/dist/types/features/generic_events/constants.d.ts.map +1 -1
- package/dist/types/features/generic_events/instrument/index.d.ts +2 -0
- package/dist/types/features/generic_events/instrument/index.d.ts.map +1 -1
- package/dist/types/features/metrics/aggregate/framework-detection.d.ts.map +1 -1
- package/dist/types/features/metrics/aggregate/harvest-metadata.d.ts +6 -0
- package/dist/types/features/metrics/aggregate/harvest-metadata.d.ts.map +1 -0
- package/dist/types/features/metrics/aggregate/index.d.ts +2 -0
- package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_replay/shared/recorder.d.ts.map +1 -1
- package/dist/types/loaders/api/noticeError.d.ts.map +1 -1
- package/dist/types/loaders/configure/configure.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/common/dom/selector-path.js +51 -39
- package/src/common/harvest/harvester.js +34 -7
- package/src/common/url/extract-url.js +17 -0
- package/src/features/ajax/instrument/index.js +2 -10
- package/src/features/generic_events/aggregate/index.js +23 -8
- package/src/features/generic_events/aggregate/user-actions/aggregated-user-action.js +5 -3
- package/src/features/generic_events/aggregate/user-actions/user-actions-aggregator.js +80 -24
- package/src/features/generic_events/constants.js +2 -0
- package/src/features/generic_events/instrument/index.js +51 -1
- package/src/features/metrics/aggregate/framework-detection.js +2 -0
- package/src/features/metrics/aggregate/harvest-metadata.js +42 -0
- package/src/features/metrics/aggregate/index.js +21 -0
- package/src/features/session_replay/aggregate/index.js +1 -1
- package/src/features/session_replay/shared/recorder.js +5 -1
- package/src/loaders/api/noticeError.js +1 -0
- package/src/loaders/configure/configure.js +1 -0
|
@@ -8,6 +8,7 @@ export const OBSERVED_EVENTS = ['auxclick', 'click', 'copy', 'keydown', 'paste',
|
|
|
8
8
|
export const OBSERVED_WINDOW_EVENTS = ['focus', 'blur'];
|
|
9
9
|
export const RAGE_CLICK_THRESHOLD_EVENTS = 4;
|
|
10
10
|
export const RAGE_CLICK_THRESHOLD_MS = 1000;
|
|
11
|
+
export const FRUSTRATION_TIMEOUT_MS = 2000;
|
|
11
12
|
export const RESERVED_EVENT_TYPES = ['PageAction', 'UserAction', 'BrowserPerformance'];
|
|
12
13
|
export const FEATURE_FLAGS = {
|
|
13
14
|
MARKS: 'experimental.marks',
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { globalScope, isBrowserScope } from '../../../common/constants/runtime';
|
|
7
7
|
import { handle } from '../../../common/event-emitter/handle';
|
|
8
|
-
import { windowAddEventListener } from '../../../common/event-listener/event-listener-opts';
|
|
8
|
+
import { eventListenerOpts, windowAddEventListener } from '../../../common/event-listener/event-listener-opts';
|
|
9
9
|
import { debounce } from '../../../common/util/invoke';
|
|
10
10
|
import { setupAddPageActionAPI } from '../../../loaders/api/addPageAction';
|
|
11
11
|
import { setupFinishedAPI } from '../../../loaders/api/finished';
|
|
@@ -14,6 +14,12 @@ import { setupRegisterAPI } from '../../../loaders/api/register';
|
|
|
14
14
|
import { setupMeasureAPI } from '../../../loaders/api/measure';
|
|
15
15
|
import { InstrumentBase } from '../../utils/instrument-base';
|
|
16
16
|
import { FEATURE_NAME, OBSERVED_EVENTS, OBSERVED_WINDOW_EVENTS } from '../constants';
|
|
17
|
+
import { FEATURE_NAMES } from '../../../loaders/features/features';
|
|
18
|
+
import { wrapHistory } from '../../../common/wrap/wrap-history';
|
|
19
|
+
import { wrapFetch } from '../../../common/wrap/wrap-fetch';
|
|
20
|
+
import { wrapXhr } from '../../../common/wrap/wrap-xhr';
|
|
21
|
+
import { parseUrl } from '../../../common/url/parse-url';
|
|
22
|
+
import { extractUrl } from '../../../common/url/extract-url';
|
|
17
23
|
export class Instrument extends InstrumentBase {
|
|
18
24
|
static featureName = FEATURE_NAME;
|
|
19
25
|
constructor(agentRef) {
|
|
@@ -52,6 +58,45 @@ export class Instrument extends InstrumentBase {
|
|
|
52
58
|
buffered: true
|
|
53
59
|
});
|
|
54
60
|
}
|
|
61
|
+
const historyEE = wrapHistory(this.ee);
|
|
62
|
+
historyEE.on('pushState-end', navigationChange);
|
|
63
|
+
historyEE.on('replaceState-end', navigationChange);
|
|
64
|
+
window.addEventListener('hashchange', navigationChange, eventListenerOpts(true, this.removeOnAbort?.signal));
|
|
65
|
+
window.addEventListener('popstate', navigationChange, eventListenerOpts(true, this.removeOnAbort?.signal));
|
|
66
|
+
function navigationChange() {
|
|
67
|
+
historyEE.emit('navChange');
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
this.removeOnAbort = new AbortController();
|
|
72
|
+
} catch (e) {}
|
|
73
|
+
this.abortHandler = () => {
|
|
74
|
+
this.removeOnAbort?.abort();
|
|
75
|
+
this.abortHandler = undefined; // weakly allow this abort op to run only once
|
|
76
|
+
};
|
|
77
|
+
globalScope.addEventListener('error', () => {
|
|
78
|
+
handle('uaErr', [], undefined, FEATURE_NAMES.genericEvents, this.ee);
|
|
79
|
+
}, eventListenerOpts(false, this.removeOnAbort?.signal));
|
|
80
|
+
wrapFetch(this.ee);
|
|
81
|
+
wrapXhr(this.ee);
|
|
82
|
+
this.ee.on('open-xhr-start', (args, xhr) => {
|
|
83
|
+
if (!isInternalTraffic(args[1])) {
|
|
84
|
+
xhr.addEventListener('readystatechange', () => {
|
|
85
|
+
if (xhr.readyState === 2) {
|
|
86
|
+
// HEADERS_RECEIVED
|
|
87
|
+
handle('uaXhr', [], undefined, FEATURE_NAMES.genericEvents, this.ee);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
this.ee.on('fetch-start', fetchArguments => {
|
|
93
|
+
if (fetchArguments.length >= 1 && !isInternalTraffic(extractUrl(fetchArguments[0]))) {
|
|
94
|
+
handle('uaXhr', [], undefined, FEATURE_NAMES.genericEvents, this.ee);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
function isInternalTraffic(url) {
|
|
98
|
+
const parsedUrl = parseUrl(url);
|
|
99
|
+
return agentRef.beacons.includes(parsedUrl.hostname + ':' + parsedUrl.port);
|
|
55
100
|
}
|
|
56
101
|
|
|
57
102
|
/** If any of the sources are active, import the aggregator. otherwise deregister */
|
|
@@ -22,6 +22,7 @@ const FRAMEWORKS = {
|
|
|
22
22
|
JQUERY: 'Jquery',
|
|
23
23
|
MOOTOOLS: 'MooTools',
|
|
24
24
|
QWIK: 'Qwik',
|
|
25
|
+
FLUTTER: 'Flutter',
|
|
25
26
|
ELECTRON: 'Electron'
|
|
26
27
|
};
|
|
27
28
|
export function getFrameworks() {
|
|
@@ -57,6 +58,7 @@ export function getFrameworks() {
|
|
|
57
58
|
if (Object.prototype.hasOwnProperty.call(window, 'jQuery')) frameworks.push(FRAMEWORKS.JQUERY);
|
|
58
59
|
if (Object.prototype.hasOwnProperty.call(window, 'MooTools')) frameworks.push(FRAMEWORKS.MOOTOOLS);
|
|
59
60
|
if (Object.prototype.hasOwnProperty.call(window, 'qwikevents')) frameworks.push(FRAMEWORKS.QWIK);
|
|
61
|
+
if (Object.hasOwn(window, '_flutter')) frameworks.push(FRAMEWORKS.FLUTTER);
|
|
60
62
|
if (detectElectron()) frameworks.push(FRAMEWORKS.ELECTRON);
|
|
61
63
|
} catch (err) {
|
|
62
64
|
// Possibly not supported
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2020-2025 New Relic, Inc. All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export function evaluateHarvestMetadata(pageMetadata) {
|
|
7
|
+
try {
|
|
8
|
+
const supportabilityTags = [];
|
|
9
|
+
|
|
10
|
+
// Report SM like... audit/<feature_name>/<hasReplay|hasTrace|hasError>/<true|false>/<negative|positive>
|
|
11
|
+
const formTag = (...strings) => strings.join('/');
|
|
12
|
+
|
|
13
|
+
// Track if replay/trace/error harvests actually occurred (key only exists when harvested)
|
|
14
|
+
function evaluateTag(feature, flag, hasFlag, hasHarvest) {
|
|
15
|
+
const AUDIT = 'audit';
|
|
16
|
+
if (hasFlag) {
|
|
17
|
+
// False positive: flag true, but no harvest
|
|
18
|
+
if (!hasHarvest) supportabilityTags.push(formTag(AUDIT, feature, flag, 'false', 'positive'));
|
|
19
|
+
// True positive (correct)
|
|
20
|
+
else supportabilityTags.push(formTag(AUDIT, feature, flag, 'true', 'positive'));
|
|
21
|
+
} else {
|
|
22
|
+
// False negative: flag false, but harvest occurred
|
|
23
|
+
if (hasHarvest) supportabilityTags.push(formTag(AUDIT, feature, flag, 'false', 'negative'));
|
|
24
|
+
// True negative (correct)
|
|
25
|
+
else supportabilityTags.push(formTag(AUDIT, feature, flag, 'true', 'negative'));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (pageMetadata.page_view_event) {
|
|
29
|
+
evaluateTag('page_view', 'hasReplay', pageMetadata.page_view_event.hasReplay, !!pageMetadata.session_replay);
|
|
30
|
+
evaluateTag('page_view', 'hasTrace', pageMetadata.page_view_event.hasTrace, !!pageMetadata.session_trace);
|
|
31
|
+
}
|
|
32
|
+
if (pageMetadata.session_replay) {
|
|
33
|
+
evaluateTag('session_replay', 'hasError', pageMetadata.session_replay.hasError, !!pageMetadata.jserrors);
|
|
34
|
+
}
|
|
35
|
+
return supportabilityTags;
|
|
36
|
+
} catch (err) {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -11,6 +11,7 @@ import { windowAddEventListener } from '../../../common/event-listener/event-lis
|
|
|
11
11
|
import { isBrowserScope, isWorkerScope } from '../../../common/constants/runtime';
|
|
12
12
|
import { AggregateBase } from '../../utils/aggregate-base';
|
|
13
13
|
import { isIFrameWindow } from '../../../common/dom/iframe';
|
|
14
|
+
import { evaluateHarvestMetadata } from './harvest-metadata';
|
|
14
15
|
// import { WEBSOCKET_TAG } from '../../../common/wrap/wrap-websocket'
|
|
15
16
|
// import { handleWebsocketEvents } from './websocket-detection'
|
|
16
17
|
|
|
@@ -19,6 +20,15 @@ export class Aggregate extends AggregateBase {
|
|
|
19
20
|
constructor(agentRef) {
|
|
20
21
|
super(agentRef, FEATURE_NAME);
|
|
21
22
|
this.harvestOpts.aggregatorTypes = ['cm', 'sm']; // the types in EventAggregator this feature cares about
|
|
23
|
+
|
|
24
|
+
/** all the harvest metadata metrics need to be evaluated simulataneously at unload time so just temporarily buffer them and dont make SMs immediately from the data */
|
|
25
|
+
this.harvestMetadata = {};
|
|
26
|
+
this.harvestOpts.beforeUnload = () => {
|
|
27
|
+
evaluateHarvestMetadata(this.harvestMetadata).forEach(smTag => {
|
|
28
|
+
this.storeSupportabilityMetrics(smTag);
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
22
32
|
// This feature only harvests once per potential EoL of the page, which is handled by the central harvester.
|
|
23
33
|
|
|
24
34
|
// this must be read/stored synchronously, as the currentScript is removed from the DOM after this script is executed and this lookup will be void
|
|
@@ -138,6 +148,17 @@ export class Aggregate extends AggregateBase {
|
|
|
138
148
|
// handleWebsocketEvents(this.storeSupportabilityMetrics.bind(this), tag, ...args)
|
|
139
149
|
// }, this.featureName, this.ee)
|
|
140
150
|
// })
|
|
151
|
+
|
|
152
|
+
/** all the harvest metadata metrics need to be evaluated simulataneously at unload time so just temporarily buffer them and dont make SMs immediately from the data */
|
|
153
|
+
registerHandler('harvest-metadata', (harvestMetadataObject = {}) => {
|
|
154
|
+
try {
|
|
155
|
+
Object.keys(harvestMetadataObject).forEach(key => {
|
|
156
|
+
Object.assign(this.harvestMetadata[key] ??= {}, harvestMetadataObject[key]);
|
|
157
|
+
});
|
|
158
|
+
} catch (e) {
|
|
159
|
+
// failed to merge harvest metadata... ignore
|
|
160
|
+
}
|
|
161
|
+
}, this.featureName, this.ee);
|
|
141
162
|
}
|
|
142
163
|
eachSessionChecks() {
|
|
143
164
|
if (!isBrowserScope) return;
|
|
@@ -52,9 +52,13 @@ export class Recorder {
|
|
|
52
52
|
this.#canRecord = false;
|
|
53
53
|
this.stopRecording();
|
|
54
54
|
}, this.srFeatureName, this.ee);
|
|
55
|
-
|
|
55
|
+
|
|
56
|
+
/** If Agg is already drained before importing the recorder (likely deferred API call pattern),
|
|
57
|
+
* registerHandler wont do anything. Just set up the on listener directly */
|
|
58
|
+
const processReplayNode = (event, isCheckout) => {
|
|
56
59
|
this.audit(event, isCheckout);
|
|
57
|
-
}
|
|
60
|
+
};
|
|
61
|
+
if (this.srInstrument.featAggregate?.drained) this.ee.on(RRWEB_DATA_CHANNEL, processReplayNode);else registerHandler(RRWEB_DATA_CHANNEL, processReplayNode, this.srFeatureName, this.ee);
|
|
58
62
|
}
|
|
59
63
|
get trigger() {
|
|
60
64
|
return this.triggerHistory[this.triggerHistory.length - 1];
|
|
@@ -13,4 +13,5 @@ export function setupNoticeErrorAPI(agent) {
|
|
|
13
13
|
export function noticeError(err, customAttributes, agentRef, targetEntityGuid, timestamp = now()) {
|
|
14
14
|
if (typeof err === 'string') err = new Error(err);
|
|
15
15
|
handle('err', [err, timestamp, false, customAttributes, agentRef.runtime.isRecording, undefined, targetEntityGuid], undefined, FEATURE_NAMES.jserrors, agentRef.ee);
|
|
16
|
+
handle('uaErr', [], undefined, FEATURE_NAMES.genericEvents, agentRef.ee);
|
|
16
17
|
}
|
|
@@ -52,6 +52,7 @@ export function configure(agent, opts = {}, loaderType, forceDrain) {
|
|
|
52
52
|
internalTrafficList.push(updatedInit.proxy.assets);
|
|
53
53
|
}
|
|
54
54
|
if (updatedInit.proxy.beacon) internalTrafficList.push(updatedInit.proxy.beacon);
|
|
55
|
+
agent.beacons = [...internalTrafficList];
|
|
55
56
|
setTopLevelCallers(agent); // no need to set global APIs on newrelic obj more than once
|
|
56
57
|
addToNREUM('activatedFeatures', activatedFeatures);
|
|
57
58
|
|
|
@@ -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/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/monkey-patched.js","../src/common/util/obfuscate.js","../src/common/util/stringify.js","../src/common/util/submit-data.js","../src/common/util/target.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/index.js","../src/features/metrics/aggregate/websocket-detection.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/entity-manager.js","../src/features/utils/event-buffer.js","../src/features/utils/event-store-manager.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/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-api.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.7.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/monkey-patched.js","../src/common/util/obfuscate.js","../src/common/util/stringify.js","../src/common/util/submit-data.js","../src/common/util/target.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/aggregate/websocket-detection.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/entity-manager.js","../src/features/utils/event-buffer.js","../src/features/utils/event-store-manager.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/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-api.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.7.3"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export function
|
|
1
|
+
export function analyzeElemPath(elem: HTMLElement, targetFields?: Array<string>): {
|
|
2
|
+
path: (undefined | string);
|
|
3
|
+
nearestFields: {};
|
|
4
|
+
hasButton: boolean;
|
|
5
|
+
hasLink: boolean;
|
|
6
|
+
};
|
|
2
7
|
//# sourceMappingURL=selector-path.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selector-path.d.ts","sourceRoot":"","sources":["../../../../src/common/dom/selector-path.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"selector-path.d.ts","sourceRoot":"","sources":["../../../../src/common/dom/selector-path.js"],"names":[],"mappings":"AAgBO,sCAJI,WAAW,iBACX,KAAK,CAAC,MAAM,CAAC,GACX;IAAC,IAAI,EAAE,CAAC,SAAS,GAAC,MAAM,CAAC,CAAC;IAAC,aAAa,EAAE,EAAE,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAC,CA2B/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harvester.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/harvester.js"],"names":[],"mappings":"AA6GA;;;;IAII;AACJ;;;;;;;;;IAFc,OAAO,
|
|
1
|
+
{"version":3,"file":"harvester.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/harvester.js"],"names":[],"mappings":"AA6GA;;;;IAII;AACJ;;;;;;;;;IAFc,OAAO,CA0HpB;AAnND;IAIE,2BAUC;IAZD,6BAA0B;IAGxB,cAAwB;IAW1B,wCASC;IAED;;;;;OAKG;IACH,iCAJW,MAAM,cACN,MAAM,GACJ,OAAO,CA+CnB;;CACF;8BAGY,OAAO,YAAY,EAAE,eAAe"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts a URL from various target types.
|
|
3
|
+
* @param {string|Request|URL} target - The target to extract the URL from. It can be a string, a Fetch Request object, or a URL object.
|
|
4
|
+
* @returns {string|undefined} The extracted URL as a string, or undefined if the target type is not supported.
|
|
5
|
+
*/
|
|
6
|
+
export function extractUrl(target: string | Request | URL): string | undefined;
|
|
7
|
+
//# sourceMappingURL=extract-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-url.d.ts","sourceRoot":"","sources":["../../../../src/common/url/extract-url.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,mCAHW,MAAM,GAAC,OAAO,GAAC,GAAG,GAChB,MAAM,GAAC,SAAS,CAM5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/instrument/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/instrument/index.js"],"names":[],"mappings":"AA8BA;IACE,2BAAiC;IACjC,2BAkCC;IA/BC,OAA0B;IAE1B,8DAAkF;CA8BrF;AA0VD,qCAA8B;+BA9YC,6BAA6B;mBAFzC,uBAAuB"}
|
|
@@ -2,7 +2,6 @@ export class Aggregate extends AggregateBase {
|
|
|
2
2
|
static featureName: string;
|
|
3
3
|
constructor(agentRef: any);
|
|
4
4
|
referrerUrl: string | undefined;
|
|
5
|
-
userActionAggregator: UserActionsAggregator;
|
|
6
5
|
/** Some keys are set by the query params or request headers sent with the harvest and override the body values, so check those before adding new standard body values...
|
|
7
6
|
* see harvest.js#baseQueryString for more info on the query params
|
|
8
7
|
* Notably:
|
|
@@ -23,8 +22,7 @@ export class Aggregate extends AggregateBase {
|
|
|
23
22
|
at: any;
|
|
24
23
|
};
|
|
25
24
|
toEpoch(timestamp: any): number;
|
|
26
|
-
|
|
25
|
+
#private;
|
|
27
26
|
}
|
|
28
27
|
import { AggregateBase } from '../../utils/aggregate-base';
|
|
29
|
-
import { UserActionsAggregator } from './user-actions/user-actions-aggregator';
|
|
30
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/generic_events/aggregate/index.js"],"names":[],"mappings":"AAiBA;IACE,2BAAiC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/generic_events/aggregate/index.js"],"names":[],"mappings":"AAiBA;IACE,2BAAiC;IAGjC,2BAkOC;IAhOC,gCAAkG;IAmOpG;;;;;;;;;;;;OAYG;IACH,eAJW,MAAM,YAAC,qBACP,MAAM,YAAC,QAiCjB;IAED,qCAEC;IAED;;;MAEC;IAED,gCAEC;;CAkBF;8BA3T6B,4BAA4B"}
|
package/dist/types/features/generic_events/aggregate/user-actions/aggregated-user-action.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export class AggregatedUserAction {
|
|
2
|
-
constructor(evt: any,
|
|
2
|
+
constructor(evt: any, selectorInfo: any);
|
|
3
3
|
event: any;
|
|
4
4
|
count: number;
|
|
5
5
|
originMs: number;
|
|
@@ -8,6 +8,8 @@ export class AggregatedUserAction {
|
|
|
8
8
|
rageClick: boolean | undefined;
|
|
9
9
|
nearestTargetFields: any;
|
|
10
10
|
currentUrl: string;
|
|
11
|
+
deadClick: boolean;
|
|
12
|
+
errorClick: boolean;
|
|
11
13
|
/**
|
|
12
14
|
* Aggregates the count and maintains the relative MS array for matching events
|
|
13
15
|
* Will determine if a rage click was observed as part of the aggregation
|
package/dist/types/features/generic_events/aggregate/user-actions/aggregated-user-action.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregated-user-action.d.ts","sourceRoot":"","sources":["../../../../../../src/features/generic_events/aggregate/user-actions/aggregated-user-action.js"],"names":[],"mappings":"AAOA;IACE,
|
|
1
|
+
{"version":3,"file":"aggregated-user-action.d.ts","sourceRoot":"","sources":["../../../../../../src/features/generic_events/aggregate/user-actions/aggregated-user-action.js"],"names":[],"mappings":"AAOA;IACE,yCAWC;IAVC,WAAgB;IAChB,cAAc;IACd,iBAAyC;IACzC,qBAAqB;IACrB,kBAAqC;IACrC,+BAA0B;IAC1B,yBAAqD;IACrD,mBAAyC;IACzC,mBAAsB;IACtB,oBAAuB;IAGzB;;;;;OAKG;IACH,eAHW,KAAK,GACH,IAAI,CAMhB;IAED;;;OAGG;IACH,eAFa,OAAO,CAKnB;CACF"}
|
package/dist/types/features/generic_events/aggregate/user-actions/user-actions-aggregator.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export class UserActionsAggregator {
|
|
2
|
+
constructor(userFrustrationsEnabled: any);
|
|
2
3
|
get aggregationEvent(): AggregatedUserAction | undefined;
|
|
3
4
|
/**
|
|
4
5
|
* Process the event and determine if a new aggregation set should be made or if it should increment the current aggregation
|
|
@@ -6,6 +7,8 @@ export class UserActionsAggregator {
|
|
|
6
7
|
* @returns {AggregatedUserAction|undefined} The previous aggregation set if it has been completed by processing the current event
|
|
7
8
|
*/
|
|
8
9
|
process(evt: Event, targetFields: any): AggregatedUserAction | undefined;
|
|
10
|
+
markAsErrorClick(): void;
|
|
11
|
+
isLiveClick(): void;
|
|
9
12
|
#private;
|
|
10
13
|
}
|
|
11
14
|
import { AggregatedUserAction } from './aggregated-user-action';
|
package/dist/types/features/generic_events/aggregate/user-actions/user-actions-aggregator.d.ts.map
CHANGED
|
@@ -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":"
|
|
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"}
|
|
@@ -3,6 +3,7 @@ export const OBSERVED_EVENTS: string[];
|
|
|
3
3
|
export const OBSERVED_WINDOW_EVENTS: string[];
|
|
4
4
|
export const RAGE_CLICK_THRESHOLD_EVENTS: 4;
|
|
5
5
|
export const RAGE_CLICK_THRESHOLD_MS: 1000;
|
|
6
|
+
export const FRUSTRATION_TIMEOUT_MS: 2000;
|
|
6
7
|
export const RESERVED_EVENT_TYPES: string[];
|
|
7
8
|
export namespace FEATURE_FLAGS {
|
|
8
9
|
let MARKS: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/generic_events/constants.js"],"names":[],"mappings":"AAMA,kCAAuD;AAEvD,uCAA6F;AAC7F,8CAAuD;AAEvD,0CAA2C,CAAC,CAAA;AAC5C,sCAAuC,IAAI,CAAA;AAE3C,4CAAsF"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/generic_events/constants.js"],"names":[],"mappings":"AAMA,kCAAuD;AAEvD,uCAA6F;AAC7F,8CAAuD;AAEvD,0CAA2C,CAAC,CAAA;AAC5C,sCAAuC,IAAI,CAAA;AAE3C,qCAAsC,IAAI,CAAA;AAE1C,4CAAsF"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export class Instrument extends InstrumentBase {
|
|
2
2
|
static featureName: string;
|
|
3
3
|
constructor(agentRef: any);
|
|
4
|
+
removeOnAbort: AbortController | undefined;
|
|
5
|
+
abortHandler: () => void;
|
|
4
6
|
}
|
|
5
7
|
export const GenericEvents: typeof Instrument;
|
|
6
8
|
import { InstrumentBase } from '../../utils/instrument-base';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/generic_events/instrument/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/generic_events/instrument/index.js"],"names":[],"mappings":"AAuBA;IACE,2BAAiC;IACjC,2BAuFC;IArCG,2CAA0C;IAG5C,yBAGC;CAgCJ;AAED,8CAAuC;+BArGR,6BAA6B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-detection.d.ts","sourceRoot":"","sources":["../../../../../src/features/metrics/aggregate/framework-detection.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"framework-detection.d.ts","sourceRoot":"","sources":["../../../../../src/features/metrics/aggregate/framework-detection.js"],"names":[],"mappings":"AAmCA,0CA8CC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harvest-metadata.d.ts","sourceRoot":"","sources":["../../../../../src/features/metrics/aggregate/harvest-metadata.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,kEAoCC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export class Aggregate extends AggregateBase {
|
|
2
2
|
static featureName: string;
|
|
3
3
|
constructor(agentRef: any);
|
|
4
|
+
/** all the harvest metadata metrics need to be evaluated simulataneously at unload time so just temporarily buffer them and dont make SMs immediately from the data */
|
|
5
|
+
harvestMetadata: {};
|
|
4
6
|
agentNonce: string | false | undefined;
|
|
5
7
|
preHarvestChecks(opts: any): any;
|
|
6
8
|
storeSupportabilityMetrics(name: any, value: any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metrics/aggregate/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metrics/aggregate/index.js"],"names":[],"mappings":"AAiBA;IACE,2BAAiC;IACjC,2BAgCC;IA5BC,uKAAuK;IACvK,oBAAyB;IAWzB,uCAAiE;IAkBnE,iCAAsE;IAEtE,wDAKC;IAED,iDAKC;IAED,qBAgFC;IAED,0BAOC;CACF;8BApJ6B,4BAA4B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/shared/recorder.js"],"names":[],"mappings":"AAqBA;IAUE,+
|
|
1
|
+
{"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/shared/recorder.js"],"names":[],"mappings":"AAqBA;IAUE,+BAiCC;IAnCD,sBAAmB;IAGjB,iDAAiD;IACjD,kBAAgC;IAEhC,QAAyB;IACzB,mBAA6C;IAC7C,cAAqC;IAErC,qBAAwB;IACxB,0FAA0F;IAC1F,eAAkE;IAElE,iHAAiH;IACjH,uBAAgD;IAChD,mFAAmF;IACnF,iCAA0D;IAC1D,uIAAuI;IACvI,yBAA4B;IAC5B,kIAAkI;IAClI,kBAAqB;IACrB,uIAAuI;IACvI,0BAAwE;IAc1E,mBAEC;IAED;;;;;;;;;MAWC;IAED,kFAAkF;IAClF,oBAGC;IAED,qDAAqD;IACrD,8CAyCC;IAED;;;;;OAKG;IACH,aAHW,GAAC,cACD,GAAC,QAiCX;IAED,yHAAyH;IACzH,yCAgCC;IAED,0HAA0H;IAC1H,yBAOC;IAED,wBAEC;IAED,gCAAgC;IAChC,uCAGC;IAED;;;SAGK;IACL,oCAGC;;CACF;+BApO8B,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noticeError.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/noticeError.js"],"names":[],"mappings":"AAUA,sDAEC;AAED,
|
|
1
|
+
{"version":3,"file":"noticeError.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/noticeError.js"],"names":[],"mappings":"AAUA,sDAEC;AAED,6HAIC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../../src/loaders/configure/configure.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../../src/loaders/configure/configure.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,oGA8DC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newrelic/browser-agent",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.299.0-rc.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
|
|
6
6
|
"description": "New Relic Browser Agent",
|
|
@@ -291,4 +291,4 @@
|
|
|
291
291
|
"README.md",
|
|
292
292
|
"CHANGELOG.md"
|
|
293
293
|
]
|
|
294
|
-
}
|
|
294
|
+
}
|
|
@@ -4,57 +4,69 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Generates a CSS selector path for the given element, if possible
|
|
7
|
+
* Generates a CSS selector path for the given element, if possible.
|
|
8
|
+
* Also gather metadata about the element's nearest fields, and whether there are any links or buttons in the path.
|
|
9
|
+
*
|
|
10
|
+
* Starts with simple cases like window or document and progresses to more complex dom-tree traversals as needed.
|
|
11
|
+
* Will return path: undefined if no other path can be determined.
|
|
12
|
+
*
|
|
8
13
|
* @param {HTMLElement} elem
|
|
9
|
-
* @param {
|
|
10
|
-
* @
|
|
11
|
-
* @returns {string|undefined}
|
|
14
|
+
* @param {Array<string>} [targetFields=[]] specifies which fields to gather from the nearest element in the path
|
|
15
|
+
* @returns {{path: (undefined|string), nearestFields: {}, hasButton: boolean, hasLink: boolean}}
|
|
12
16
|
*/
|
|
13
|
-
export const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
let i = 1
|
|
19
|
-
const { tagName } = node
|
|
20
|
-
while (node.previousElementSibling) {
|
|
21
|
-
if (node.previousElementSibling.tagName === tagName) i++
|
|
22
|
-
node = node.previousElementSibling
|
|
23
|
-
}
|
|
24
|
-
return i
|
|
25
|
-
} catch (err) {
|
|
26
|
-
// do nothing for now. An invalid child count will make the path selector not return a nth-of-type selector statement
|
|
27
|
-
}
|
|
28
|
-
}
|
|
17
|
+
export const analyzeElemPath = (elem, targetFields = []) => {
|
|
18
|
+
const result = { path: undefined, nearestFields: {}, hasButton: false, hasLink: false }
|
|
19
|
+
if (!elem) return result
|
|
20
|
+
if (elem === window) { result.path = 'window'; return result }
|
|
21
|
+
if (elem === document) { result.path = 'document'; return result }
|
|
29
22
|
|
|
30
23
|
let pathSelector = ''
|
|
31
|
-
|
|
24
|
+
const index = getNthOfTypeIndex(elem)
|
|
32
25
|
|
|
33
|
-
const nearestFields = {}
|
|
34
26
|
try {
|
|
35
27
|
while (elem?.tagName) {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
].join('')
|
|
43
|
-
|
|
44
|
-
pathSelector = selector
|
|
28
|
+
const tagName = elem.tagName.toLowerCase()
|
|
29
|
+
result.hasLink ||= tagName === 'a'
|
|
30
|
+
result.hasButton ||= tagName === 'button' || (tagName === 'input' && elem.type.toLowerCase() === 'button')
|
|
31
|
+
|
|
32
|
+
targetFields.forEach(field => { result.nearestFields[nearestAttrName(field)] ||= (elem[field]?.baseVal || elem[field]) })
|
|
33
|
+
pathSelector = buildPathSelector(elem, pathSelector)
|
|
45
34
|
elem = elem.parentNode
|
|
46
35
|
}
|
|
47
36
|
} catch (err) {
|
|
48
|
-
|
|
37
|
+
// do nothing for now
|
|
49
38
|
}
|
|
50
39
|
|
|
51
|
-
|
|
52
|
-
return
|
|
40
|
+
result.path = pathSelector ? index ? `${pathSelector}:nth-of-type(${index})` : pathSelector : undefined
|
|
41
|
+
return result
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function buildPathSelector (elem, pathSelector) {
|
|
45
|
+
const { id, localName } = elem
|
|
46
|
+
return [
|
|
47
|
+
localName,
|
|
48
|
+
id ? `#${id}` : '',
|
|
49
|
+
pathSelector ? `>${pathSelector}` : ''
|
|
50
|
+
].join('')
|
|
51
|
+
}
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
function getNthOfTypeIndex (node) {
|
|
54
|
+
try {
|
|
55
|
+
let i = 1
|
|
56
|
+
const { tagName } = node
|
|
57
|
+
while (node.previousElementSibling) {
|
|
58
|
+
if (node.previousElementSibling.tagName === tagName) i++
|
|
59
|
+
node = node.previousElementSibling
|
|
60
|
+
}
|
|
61
|
+
return i
|
|
62
|
+
} catch (err) {
|
|
63
|
+
// do nothing for now. An invalid child count will make the path selector not return a nth-of-type selector statement
|
|
59
64
|
}
|
|
60
65
|
}
|
|
66
|
+
|
|
67
|
+
function nearestAttrName (originalFieldName) {
|
|
68
|
+
/** preserve original renaming structure for pre-existing field maps */
|
|
69
|
+
if (originalFieldName === 'tagName') originalFieldName = 'tag'
|
|
70
|
+
if (originalFieldName === 'className') originalFieldName = 'class'
|
|
71
|
+
return `nearest${originalFieldName.charAt(0).toUpperCase() + originalFieldName.slice(1)}`
|
|
72
|
+
}
|