@newrelic/browser-agent 1.263.0 → 1.264.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +2 -2
- package/dist/cjs/cdn/experimental.js +3 -7
- package/dist/cjs/cdn/pro.js +2 -2
- package/dist/cjs/cdn/spa.js +2 -2
- package/dist/cjs/common/aggregate/aggregator.js +3 -3
- package/dist/cjs/common/config/state/init.js +6 -3
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/constants/runtime.js +1 -3
- package/dist/cjs/common/drain/drain.js +4 -4
- package/dist/cjs/common/harvest/harvest.js +2 -2
- package/dist/cjs/common/serialize/bel-serializer.js +2 -2
- package/dist/cjs/common/session/session-entity.js +1 -1
- package/dist/cjs/common/url/encode.js +3 -5
- package/dist/cjs/common/util/submit-data.js +0 -1
- package/dist/cjs/common/vitals/vital-metric.js +1 -1
- package/dist/cjs/features/ajax/aggregate/index.js +1 -1
- package/dist/cjs/features/ajax/instrument/index.js +1 -1
- package/dist/cjs/features/generic_events/aggregate/index.js +137 -0
- package/dist/cjs/features/generic_events/constants.js +8 -0
- package/dist/cjs/features/generic_events/index.js +12 -0
- package/dist/cjs/features/generic_events/instrument/index.js +27 -0
- package/dist/cjs/features/jserrors/aggregate/index.js +13 -12
- package/dist/cjs/features/jserrors/instrument/index.js +1 -1
- package/dist/cjs/features/logging/aggregate/index.js +1 -1
- package/dist/cjs/features/logging/instrument/index.js +1 -1
- package/dist/cjs/features/metrics/aggregate/index.js +1 -1
- package/dist/cjs/features/metrics/instrument/index.js +1 -1
- package/dist/cjs/features/page_action/instrument/index.js +6 -6
- package/dist/cjs/features/page_view_event/aggregate/index.js +1 -1
- package/dist/cjs/features/page_view_event/aggregate/initialized-features.js +1 -1
- package/dist/cjs/features/page_view_event/instrument/index.js +1 -1
- package/dist/cjs/features/page_view_timing/aggregate/index.js +3 -3
- package/dist/cjs/features/page_view_timing/instrument/index.js +1 -1
- package/dist/cjs/features/session_replay/aggregate/index.js +2 -2
- package/dist/cjs/features/session_replay/instrument/index.js +1 -1
- package/dist/cjs/features/session_replay/shared/stylesheet-evaluator.js +1 -1
- package/dist/cjs/features/session_trace/aggregate/index.js +1 -1
- package/dist/cjs/features/session_trace/aggregate/trace/storage.js +2 -2
- package/dist/cjs/features/session_trace/instrument/index.js +1 -1
- package/dist/cjs/features/soft_navigations/aggregate/bel-node.js +1 -1
- package/dist/cjs/features/soft_navigations/aggregate/index.js +1 -1
- package/dist/cjs/features/soft_navigations/aggregate/interaction.js +5 -5
- package/dist/cjs/features/soft_navigations/instrument/index.js +1 -1
- package/dist/cjs/features/spa/aggregate/index.js +2 -3
- package/dist/cjs/features/spa/aggregate/interaction.js +2 -2
- package/dist/cjs/features/spa/aggregate/serializer.js +1 -2
- package/dist/cjs/features/spa/instrument/index.js +1 -1
- package/dist/cjs/features/utils/aggregate-base.js +2 -0
- package/dist/cjs/features/utils/lazy-feature-loader.js +2 -2
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/loaders/agent-base.js +0 -4
- package/dist/cjs/loaders/api/api.js +1 -1
- package/dist/cjs/loaders/api/apiAsync.js +1 -1
- package/dist/cjs/loaders/browser-agent.js +4 -3
- package/dist/cjs/loaders/configure/configure.js +4 -3
- package/dist/cjs/loaders/features/features.js +8 -4
- package/dist/cjs/loaders/micro-agent.js +1 -1
- package/dist/esm/cdn/experimental.js +2 -5
- package/dist/esm/cdn/pro.js +2 -2
- package/dist/esm/cdn/spa.js +2 -2
- package/dist/esm/common/aggregate/aggregator.js +3 -3
- package/dist/esm/common/config/state/init.js +6 -3
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/constants/runtime.js +0 -2
- package/dist/esm/common/drain/drain.js +4 -4
- package/dist/esm/common/harvest/harvest.js +3 -3
- package/dist/esm/common/serialize/bel-serializer.js +2 -2
- package/dist/esm/common/session/session-entity.js +2 -2
- package/dist/esm/common/url/encode.js +3 -5
- package/dist/esm/common/util/submit-data.js +0 -1
- package/dist/esm/common/vitals/vital-metric.js +1 -1
- package/dist/esm/features/ajax/aggregate/index.js +1 -1
- package/dist/esm/features/ajax/instrument/index.js +1 -1
- package/dist/esm/features/generic_events/aggregate/index.js +129 -0
- package/dist/esm/features/generic_events/constants.js +2 -0
- package/dist/esm/features/generic_events/index.js +1 -0
- package/dist/esm/features/generic_events/instrument/index.js +20 -0
- package/dist/esm/features/jserrors/aggregate/index.js +13 -12
- package/dist/esm/features/jserrors/instrument/index.js +1 -1
- package/dist/esm/features/logging/aggregate/index.js +1 -1
- package/dist/esm/features/logging/instrument/index.js +1 -1
- package/dist/esm/features/metrics/aggregate/index.js +1 -1
- package/dist/esm/features/metrics/instrument/index.js +1 -1
- package/dist/esm/features/page_action/instrument/index.js +7 -6
- package/dist/esm/features/page_view_event/aggregate/index.js +1 -1
- package/dist/esm/features/page_view_event/aggregate/initialized-features.js +1 -1
- package/dist/esm/features/page_view_event/instrument/index.js +1 -1
- package/dist/esm/features/page_view_timing/aggregate/index.js +3 -3
- package/dist/esm/features/page_view_timing/instrument/index.js +1 -1
- package/dist/esm/features/session_replay/aggregate/index.js +2 -2
- package/dist/esm/features/session_replay/instrument/index.js +1 -1
- package/dist/esm/features/session_replay/shared/stylesheet-evaluator.js +1 -1
- package/dist/esm/features/session_trace/aggregate/index.js +1 -1
- package/dist/esm/features/session_trace/aggregate/trace/storage.js +2 -2
- package/dist/esm/features/session_trace/instrument/index.js +1 -1
- package/dist/esm/features/soft_navigations/aggregate/bel-node.js +1 -1
- package/dist/esm/features/soft_navigations/aggregate/index.js +1 -1
- package/dist/esm/features/soft_navigations/aggregate/interaction.js +5 -5
- package/dist/esm/features/soft_navigations/instrument/index.js +1 -1
- package/dist/esm/features/spa/aggregate/index.js +2 -3
- package/dist/esm/features/spa/aggregate/interaction.js +2 -2
- package/dist/esm/features/spa/aggregate/serializer.js +1 -2
- package/dist/esm/features/spa/instrument/index.js +1 -1
- package/dist/esm/features/utils/aggregate-base.js +3 -1
- package/dist/esm/features/utils/lazy-feature-loader.js +2 -2
- package/dist/esm/index.js +3 -0
- package/dist/esm/loaders/agent-base.js +0 -4
- package/dist/esm/loaders/api/api.js +1 -1
- package/dist/esm/loaders/api/apiAsync.js +1 -1
- package/dist/esm/loaders/browser-agent.js +3 -2
- package/dist/esm/loaders/configure/configure.js +4 -3
- package/dist/esm/loaders/features/features.js +8 -4
- package/dist/esm/loaders/micro-agent.js +1 -1
- package/dist/types/common/aggregate/aggregator.d.ts.map +1 -1
- package/dist/types/common/config/state/init.d.ts.map +1 -1
- package/dist/types/common/constants/runtime.d.ts +0 -1
- package/dist/types/common/constants/runtime.d.ts.map +1 -1
- package/dist/types/common/drain/drain.d.ts.map +1 -1
- package/dist/types/common/serialize/bel-serializer.d.ts.map +1 -1
- package/dist/types/common/url/encode.d.ts.map +1 -1
- package/dist/types/common/util/submit-data.d.ts.map +1 -1
- package/dist/types/features/{page_action → generic_events}/aggregate/index.d.ts +7 -5
- package/dist/types/features/generic_events/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/generic_events/constants.d.ts +2 -0
- package/dist/types/features/generic_events/constants.d.ts.map +1 -0
- package/dist/types/features/generic_events/index.d.ts +2 -0
- package/dist/types/features/generic_events/index.d.ts.map +1 -0
- package/dist/types/features/generic_events/instrument/index.d.ts +6 -0
- package/dist/types/features/generic_events/instrument/index.d.ts.map +1 -0
- package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_action/instrument/index.d.ts +5 -4
- package/dist/types/features/page_action/instrument/index.d.ts.map +1 -1
- package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/spa/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/spa/aggregate/interaction.d.ts.map +1 -1
- package/dist/types/features/spa/aggregate/serializer.d.ts.map +1 -1
- package/dist/types/features/utils/aggregate-base.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/loaders/agent-base.d.ts +0 -1
- package/dist/types/loaders/agent-base.d.ts.map +1 -1
- package/dist/types/loaders/browser-agent.d.ts.map +1 -1
- package/dist/types/loaders/configure/configure.d.ts.map +1 -1
- package/dist/types/loaders/features/features.d.ts +1 -0
- package/dist/types/loaders/features/features.d.ts.map +1 -1
- package/package.json +25 -6
- package/src/cdn/experimental.js +2 -4
- package/src/cdn/pro.js +2 -2
- package/src/cdn/spa.js +2 -2
- package/src/common/aggregate/aggregator.js +2 -3
- package/src/common/config/state/init.js +2 -1
- package/src/common/constants/runtime.js +0 -2
- package/src/common/drain/drain.js +3 -4
- package/src/common/harvest/harvest.js +3 -3
- package/src/common/serialize/bel-serializer.js +1 -2
- package/src/common/session/session-entity.js +2 -2
- package/src/common/url/encode.js +2 -3
- package/src/common/util/submit-data.js +0 -1
- package/src/features/generic_events/aggregate/index.js +133 -0
- package/src/features/generic_events/constants.js +3 -0
- package/src/features/generic_events/index.js +1 -0
- package/src/features/generic_events/instrument/index.js +22 -0
- package/src/features/jserrors/aggregate/index.js +4 -5
- package/src/features/page_action/instrument/index.js +6 -6
- package/src/features/page_view_event/aggregate/initialized-features.js +1 -1
- package/src/features/page_view_timing/aggregate/index.js +1 -2
- package/src/features/spa/aggregate/index.js +1 -2
- package/src/features/spa/aggregate/interaction.js +1 -2
- package/src/features/spa/aggregate/serializer.js +1 -2
- package/src/features/utils/aggregate-base.js +3 -1
- package/src/features/utils/lazy-feature-loader.js +2 -2
- package/src/index.js +3 -0
- package/src/loaders/agent-base.js +0 -4
- package/src/loaders/api/api.js +1 -1
- package/src/loaders/api/apiAsync.js +1 -1
- package/src/loaders/browser-agent.js +5 -3
- package/src/loaders/configure/configure.js +5 -1
- package/src/loaders/features/features.js +8 -4
- package/src/loaders/micro-agent.js +1 -1
- package/dist/cjs/cdn/polyfills/lite.js +0 -16
- package/dist/cjs/cdn/polyfills/pro.js +0 -21
- package/dist/cjs/cdn/polyfills/spa.js +0 -22
- package/dist/cjs/cdn/polyfills.js +0 -24
- package/dist/cjs/common/util/map-own.js +0 -31
- package/dist/cjs/features/page_action/aggregate/index.js +0 -121
- package/dist/esm/cdn/polyfills/lite.js +0 -14
- package/dist/esm/cdn/polyfills/pro.js +0 -19
- package/dist/esm/cdn/polyfills/spa.js +0 -20
- package/dist/esm/cdn/polyfills.js +0 -27
- package/dist/esm/common/util/map-own.js +0 -24
- package/dist/esm/features/page_action/aggregate/index.js +0 -114
- package/dist/types/cdn/polyfills/lite.d.ts +0 -2
- package/dist/types/cdn/polyfills/lite.d.ts.map +0 -1
- package/dist/types/cdn/polyfills/pro.d.ts +0 -2
- package/dist/types/cdn/polyfills/pro.d.ts.map +0 -1
- package/dist/types/cdn/polyfills/spa.d.ts +0 -2
- package/dist/types/cdn/polyfills/spa.d.ts.map +0 -1
- package/dist/types/cdn/polyfills.d.ts +0 -2
- package/dist/types/cdn/polyfills.d.ts.map +0 -1
- package/dist/types/common/util/map-own.d.ts +0 -3
- package/dist/types/common/util/map-own.d.ts.map +0 -1
- package/dist/types/features/page_action/aggregate/index.d.ts.map +0 -1
- package/src/cdn/polyfills/lite.js +0 -20
- package/src/cdn/polyfills/pro.js +0 -30
- package/src/cdn/polyfills/spa.js +0 -32
- package/src/cdn/polyfills.js +0 -27
- package/src/common/util/map-own.js +0 -22
- package/src/features/page_action/aggregate/index.js +0 -114
package/src/cdn/polyfills/spa.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Creates a version of the "SPA" agent loader with [core-js]{@link https://github.com/zloirock/core-js}
|
|
3
|
-
* polyfills for pre-ES6 browsers and IE 11.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import '../polyfills.js'
|
|
7
|
-
import { Agent } from '../../loaders/agent'
|
|
8
|
-
|
|
9
|
-
import { Instrument as InstrumentPageViewEvent } from '../../features/page_view_event/instrument'
|
|
10
|
-
import { Instrument as InstrumentPageViewTiming } from '../../features/page_view_timing/instrument'
|
|
11
|
-
import { Instrument as InstrumentMetrics } from '../../features/metrics/instrument'
|
|
12
|
-
import { Instrument as InstrumentErrors } from '../../features/jserrors/instrument'
|
|
13
|
-
import { Instrument as InstrumentXhr } from '../../features/ajax/instrument'
|
|
14
|
-
import { Instrument as InstrumentSessionTrace } from '../../features/session_trace/instrument'
|
|
15
|
-
import { Instrument as InstrumentSpa } from '../../features/spa/instrument'
|
|
16
|
-
import { Instrument as InstrumentPageAction } from '../../features/page_action/instrument'
|
|
17
|
-
import { Instrument as InstrumentLogs } from '../../features/logging/instrument'
|
|
18
|
-
|
|
19
|
-
new Agent({
|
|
20
|
-
features: [
|
|
21
|
-
InstrumentXhr,
|
|
22
|
-
InstrumentPageViewEvent,
|
|
23
|
-
InstrumentPageViewTiming,
|
|
24
|
-
InstrumentSessionTrace,
|
|
25
|
-
InstrumentMetrics,
|
|
26
|
-
InstrumentPageAction,
|
|
27
|
-
InstrumentErrors,
|
|
28
|
-
InstrumentLogs,
|
|
29
|
-
InstrumentSpa
|
|
30
|
-
],
|
|
31
|
-
loaderType: 'spa-polyfills'
|
|
32
|
-
})
|
package/src/cdn/polyfills.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Selectively imports {@link https://github.com/zloirock/core-js core-js}
|
|
3
|
-
* polyfills needed for pre-ES6 browsers and IE 11.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import 'core-js/stable/promise'
|
|
7
|
-
import 'core-js/stable/array/includes'
|
|
8
|
-
import 'core-js/stable/array/find'
|
|
9
|
-
import 'core-js/stable/array/flat'
|
|
10
|
-
import 'core-js/stable/array/flat-map'
|
|
11
|
-
import 'core-js/stable/array/from'
|
|
12
|
-
import 'core-js/stable/array/some'
|
|
13
|
-
import 'core-js/stable/array/find-index'
|
|
14
|
-
import 'core-js/stable/object/assign'
|
|
15
|
-
import 'core-js/stable/object/entries'
|
|
16
|
-
import 'core-js/stable/object/values'
|
|
17
|
-
import 'core-js/stable/object/from-entries'
|
|
18
|
-
import 'core-js/stable/map'
|
|
19
|
-
import 'core-js/stable/reflect'
|
|
20
|
-
import 'core-js/stable/set'
|
|
21
|
-
import 'core-js/stable/weak-set'
|
|
22
|
-
import 'core-js/stable/object/get-own-property-descriptors'
|
|
23
|
-
import 'core-js/stable/url'
|
|
24
|
-
import 'core-js/stable/url-search-params'
|
|
25
|
-
import 'core-js/stable/string/starts-with'
|
|
26
|
-
import 'core-js/stable/number/is-nan'
|
|
27
|
-
import 'core-js/stable/string/includes'
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @typedef {function} MapOwnCallback
|
|
8
|
-
* @param {string} key Object key
|
|
9
|
-
* @param {any} value Object value
|
|
10
|
-
* @returns {any}
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Iterates the own enumerable properties of an object passing the key and value pair to a given
|
|
15
|
-
* callback function.
|
|
16
|
-
* @param {object} obj Input object to iterate over. If null or undefined, an empty array will be returned.
|
|
17
|
-
* @param {MapOwnCallback} fn A callback function called for each property. The callback should take the key
|
|
18
|
-
* and value from the object iteration and return some value.
|
|
19
|
-
* @returns {any[]} An array of values returned by the callback function.
|
|
20
|
-
*/
|
|
21
|
-
export const mapOwn = (obj, fn) => Object.entries(obj || {})
|
|
22
|
-
.map(([key, value]) => fn(key, value))
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { mapOwn } from '../../../common/util/map-own'
|
|
7
|
-
import { stringify } from '../../../common/util/stringify'
|
|
8
|
-
import { registerHandler as register } from '../../../common/event-emitter/register-handler'
|
|
9
|
-
import { HarvestScheduler } from '../../../common/harvest/harvest-scheduler'
|
|
10
|
-
import { cleanURL } from '../../../common/url/clean-url'
|
|
11
|
-
import { getConfigurationValue, getInfo, getRuntime } from '../../../common/config/config'
|
|
12
|
-
import { FEATURE_NAME } from '../constants'
|
|
13
|
-
import { isBrowserScope } from '../../../common/constants/runtime'
|
|
14
|
-
import { AggregateBase } from '../../utils/aggregate-base'
|
|
15
|
-
import { deregisterDrain } from '../../../common/drain/drain'
|
|
16
|
-
|
|
17
|
-
export class Aggregate extends AggregateBase {
|
|
18
|
-
static featureName = FEATURE_NAME
|
|
19
|
-
constructor (agentIdentifier, aggregator) {
|
|
20
|
-
super(agentIdentifier, aggregator, FEATURE_NAME)
|
|
21
|
-
this.eventsPerMinute = 240
|
|
22
|
-
this.harvestTimeSeconds = getConfigurationValue(this.agentIdentifier, 'page_action.harvestTimeSeconds') || getConfigurationValue(this.agentIdentifier, 'ins.harvestTimeSeconds') || 30
|
|
23
|
-
this.eventsPerHarvest = this.eventsPerMinute * this.harvestTimeSeconds / 60
|
|
24
|
-
this.referrerUrl = undefined
|
|
25
|
-
this.currentEvents = undefined
|
|
26
|
-
|
|
27
|
-
this.events = []
|
|
28
|
-
|
|
29
|
-
this.att = getInfo(this.agentIdentifier).jsAttributes // per-agent, aggregators-shared info context
|
|
30
|
-
|
|
31
|
-
if (isBrowserScope && document.referrer) this.referrerUrl = cleanURL(document.referrer)
|
|
32
|
-
|
|
33
|
-
register('api-addPageAction', (...args) => this.addPageAction(...args), this.featureName, this.ee)
|
|
34
|
-
|
|
35
|
-
this.waitForFlags(['ins']).then(([insFlag]) => {
|
|
36
|
-
if (insFlag) {
|
|
37
|
-
const scheduler = new HarvestScheduler('ins', { onFinished: (...args) => this.onHarvestFinished(...args) }, this)
|
|
38
|
-
scheduler.harvest.on('ins', (...args) => this.onHarvestStarted(...args))
|
|
39
|
-
scheduler.startTimer(this.harvestTimeSeconds, 0)
|
|
40
|
-
this.drain()
|
|
41
|
-
} else {
|
|
42
|
-
this.blocked = true // if rum response determines that customer lacks entitlements for ins endpoint, this feature shouldn't harvest
|
|
43
|
-
deregisterDrain(this.agentIdentifier, this.featureName)
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
onHarvestStarted (options) {
|
|
49
|
-
const { userAttributes, atts } = getInfo(this.agentIdentifier)
|
|
50
|
-
var payload = ({
|
|
51
|
-
qs: {
|
|
52
|
-
ua: userAttributes,
|
|
53
|
-
at: atts
|
|
54
|
-
},
|
|
55
|
-
body: {
|
|
56
|
-
ins: this.events
|
|
57
|
-
}
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
if (options.retry) {
|
|
61
|
-
this.currentEvents = this.events
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
this.events = []
|
|
65
|
-
return payload
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
onHarvestFinished (result) {
|
|
69
|
-
if (result && result.sent && result.retry && this.currentEvents) {
|
|
70
|
-
this.events = this.events.concat(this.currentEvents)
|
|
71
|
-
this.currentEvents = null
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// WARNING: Insights times are in seconds. EXCEPT timestamp, which is in ms.
|
|
76
|
-
addPageAction (t, name, attributes) {
|
|
77
|
-
if (this.events.length >= this.eventsPerHarvest || this.blocked) return
|
|
78
|
-
var width
|
|
79
|
-
var height
|
|
80
|
-
var eventAttributes = {}
|
|
81
|
-
|
|
82
|
-
if (isBrowserScope && window.document.documentElement) {
|
|
83
|
-
// Doesn't include the nav bar when it disappears in mobile safari
|
|
84
|
-
// https://github.com/jquery/jquery/blob/10399ddcf8a239acc27bdec9231b996b178224d3/src/dimensions.js#L23
|
|
85
|
-
width = window.document.documentElement.clientWidth
|
|
86
|
-
height = window.document.documentElement.clientHeight
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const agentRuntime = getRuntime(this.agentIdentifier)
|
|
90
|
-
var defaults = {
|
|
91
|
-
timestamp: agentRuntime.timeKeeper.convertRelativeTimestamp(t),
|
|
92
|
-
timeSinceLoad: t / 1000,
|
|
93
|
-
browserWidth: width,
|
|
94
|
-
browserHeight: height,
|
|
95
|
-
referrerUrl: this.referrerUrl,
|
|
96
|
-
currentUrl: cleanURL('' + location),
|
|
97
|
-
pageUrl: cleanURL(agentRuntime.origin),
|
|
98
|
-
eventType: 'PageAction'
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
mapOwn(defaults, set)
|
|
102
|
-
mapOwn(getInfo(this.agentIdentifier).jsAttributes, set)
|
|
103
|
-
if (attributes && typeof attributes === 'object') {
|
|
104
|
-
mapOwn(attributes, set)
|
|
105
|
-
}
|
|
106
|
-
eventAttributes.actionName = name || ''
|
|
107
|
-
|
|
108
|
-
this.events.push(eventAttributes)
|
|
109
|
-
|
|
110
|
-
function set (key, val) {
|
|
111
|
-
eventAttributes[key] = (val && typeof val === 'object' ? stringify(val) : val)
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|