@newrelic/browser-agent 1.235.0 → 1.237.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/README.md +41 -1
- package/dist/cjs/common/config/state/init.js +4 -0
- package/dist/cjs/common/config/state/runtime.js +6 -5
- package/dist/cjs/common/constants/env.cdn.js +2 -2
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/constants/runtime.js +52 -0
- package/dist/cjs/common/deny-list/deny-list.js +14 -10
- package/dist/cjs/common/event-listener/event-listener-opts.js +3 -3
- package/dist/cjs/common/harvest/harvest-scheduler.js +22 -19
- package/dist/cjs/common/harvest/harvest.js +154 -148
- package/dist/cjs/common/harvest/types.js +54 -0
- package/dist/cjs/common/ids/id.js +2 -2
- package/dist/cjs/common/ids/unique-id.js +3 -3
- package/dist/cjs/common/session/session-entity.js +2 -2
- package/dist/cjs/common/timer/interaction-timer.js +2 -2
- package/dist/cjs/common/unload/eol.js +10 -11
- package/dist/cjs/common/url/canonicalize-url.js +2 -2
- package/dist/cjs/common/url/parse-url.js +3 -3
- package/dist/cjs/common/url/protocol.js +2 -2
- package/dist/cjs/common/util/submit-data.js +31 -81
- package/dist/cjs/common/window/nreum.js +14 -14
- package/dist/cjs/common/wrap/wrap-events.js +3 -3
- package/dist/cjs/common/wrap/wrap-fetch.js +5 -5
- package/dist/cjs/common/wrap/wrap-history.js +2 -2
- package/dist/cjs/common/wrap/wrap-jsonp.js +14 -8
- package/dist/cjs/common/wrap/wrap-mutation.js +2 -2
- package/dist/cjs/common/wrap/wrap-promise.js +2 -2
- package/dist/cjs/common/wrap/wrap-raf.js +2 -2
- package/dist/cjs/common/wrap/wrap-timer.js +4 -4
- package/dist/cjs/common/wrap/wrap-xhr.js +3 -3
- package/dist/cjs/features/ajax/aggregate/index.js +25 -28
- package/dist/cjs/features/ajax/instrument/distributed-tracing.js +2 -2
- package/dist/cjs/features/ajax/instrument/index.js +6 -7
- package/dist/cjs/features/jserrors/aggregate/compute-stack-trace.js +1 -1
- package/dist/cjs/features/jserrors/aggregate/index.js +7 -4
- package/dist/cjs/features/jserrors/constants.js +2 -4
- package/dist/cjs/features/jserrors/instrument/index.js +80 -89
- package/dist/cjs/features/jserrors/instrument/uncaught-error.js +22 -0
- package/dist/cjs/features/metrics/aggregate/framework-detection.js +2 -2
- package/dist/cjs/features/metrics/aggregate/index.js +3 -3
- package/dist/cjs/features/page_action/aggregate/index.js +3 -3
- package/dist/cjs/features/page_view_event/aggregate/index.js +10 -11
- package/dist/cjs/features/page_view_event/aggregate/initialized-features.js +23 -19
- package/dist/cjs/features/page_view_event/instrument/index.js +2 -2
- package/dist/cjs/features/page_view_timing/aggregate/index.js +3 -5
- package/dist/cjs/features/page_view_timing/instrument/index.js +2 -2
- package/dist/cjs/features/session_replay/aggregate/index.js +65 -34
- package/dist/cjs/features/session_replay/replay-mode.js +2 -2
- package/dist/cjs/features/session_trace/aggregate/index.js +3 -4
- package/dist/cjs/features/session_trace/instrument/index.js +2 -2
- package/dist/cjs/features/spa/aggregate/index.js +1 -1
- package/dist/cjs/features/spa/instrument/index.js +2 -2
- package/dist/cjs/features/utils/instrument-base.js +12 -15
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/loaders/agent-base.js +87 -0
- package/dist/cjs/loaders/agent.js +48 -1
- package/dist/cjs/loaders/api/api.js +3 -3
- package/dist/cjs/loaders/api/apiAsync.js +6 -4
- package/dist/cjs/loaders/api/interaction-types.js +87 -0
- package/dist/cjs/loaders/configure/configure.js +4 -3
- package/dist/cjs/loaders/micro-agent.js +32 -39
- package/dist/esm/common/config/state/init.js +4 -0
- package/dist/esm/common/config/state/runtime.js +3 -2
- package/dist/esm/common/constants/env.cdn.js +2 -2
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/constants/runtime.js +38 -0
- package/dist/esm/common/deny-list/deny-list.js +14 -10
- package/dist/esm/common/event-listener/event-listener-opts.js +1 -1
- package/dist/esm/common/harvest/harvest-scheduler.js +21 -20
- package/dist/esm/common/harvest/harvest.js +150 -146
- package/dist/esm/common/harvest/types.js +47 -0
- package/dist/esm/common/ids/id.js +1 -1
- package/dist/esm/common/ids/unique-id.js +1 -1
- package/dist/esm/common/session/session-entity.js +1 -1
- package/dist/esm/common/timer/interaction-timer.js +1 -1
- package/dist/esm/common/unload/eol.js +1 -2
- package/dist/esm/common/url/canonicalize-url.js +1 -1
- package/dist/esm/common/url/parse-url.js +1 -1
- package/dist/esm/common/url/protocol.js +1 -1
- package/dist/esm/common/util/submit-data.js +29 -78
- package/dist/esm/common/window/nreum.js +1 -1
- package/dist/esm/common/wrap/wrap-events.js +1 -1
- package/dist/esm/common/wrap/wrap-fetch.js +1 -1
- package/dist/esm/common/wrap/wrap-history.js +1 -1
- package/dist/esm/common/wrap/wrap-jsonp.js +13 -7
- package/dist/esm/common/wrap/wrap-mutation.js +1 -1
- package/dist/esm/common/wrap/wrap-promise.js +1 -1
- package/dist/esm/common/wrap/wrap-raf.js +1 -1
- package/dist/esm/common/wrap/wrap-timer.js +1 -1
- package/dist/esm/common/wrap/wrap-xhr.js +1 -1
- package/dist/esm/features/ajax/aggregate/index.js +26 -29
- package/dist/esm/features/ajax/instrument/distributed-tracing.js +1 -1
- package/dist/esm/features/ajax/instrument/index.js +1 -2
- package/dist/esm/features/jserrors/aggregate/compute-stack-trace.js +1 -1
- package/dist/esm/features/jserrors/aggregate/index.js +6 -3
- package/dist/esm/features/jserrors/constants.js +1 -2
- package/dist/esm/features/jserrors/instrument/index.js +79 -88
- package/dist/esm/features/jserrors/instrument/uncaught-error.js +15 -0
- package/dist/esm/features/metrics/aggregate/framework-detection.js +1 -1
- package/dist/esm/features/metrics/aggregate/index.js +1 -1
- package/dist/esm/features/page_action/aggregate/index.js +1 -1
- package/dist/esm/features/page_view_event/aggregate/index.js +1 -2
- package/dist/esm/features/page_view_event/aggregate/initialized-features.js +23 -19
- package/dist/esm/features/page_view_event/instrument/index.js +1 -1
- package/dist/esm/features/page_view_timing/aggregate/index.js +2 -4
- package/dist/esm/features/page_view_timing/instrument/index.js +1 -1
- package/dist/esm/features/session_replay/aggregate/index.js +65 -34
- package/dist/esm/features/session_replay/replay-mode.js +2 -2
- package/dist/esm/features/session_trace/aggregate/index.js +3 -4
- package/dist/esm/features/session_trace/instrument/index.js +1 -1
- package/dist/esm/features/spa/aggregate/index.js +1 -1
- package/dist/esm/features/spa/instrument/index.js +1 -1
- package/dist/esm/features/utils/instrument-base.js +11 -14
- package/dist/esm/index.js +1 -4
- package/dist/esm/loaders/agent-base.js +80 -0
- package/dist/esm/loaders/agent.js +48 -1
- package/dist/esm/loaders/api/api.js +2 -2
- package/dist/esm/loaders/api/apiAsync.js +3 -3
- package/dist/esm/loaders/api/interaction-types.js +80 -0
- package/dist/esm/loaders/configure/configure.js +4 -3
- package/dist/esm/loaders/micro-agent.js +32 -39
- package/dist/types/common/config/state/init.d.ts.map +1 -1
- package/dist/types/common/config/state/runtime.d.ts.map +1 -1
- package/dist/types/common/constants/runtime.d.ts +29 -0
- package/dist/types/common/constants/runtime.d.ts.map +1 -0
- package/dist/types/common/event-emitter/register-handler.d.ts +1 -1
- package/dist/types/common/harvest/harvest-scheduler.d.ts +1 -1
- package/dist/types/common/harvest/harvest-scheduler.d.ts.map +1 -1
- package/dist/types/common/harvest/harvest.d.ts +49 -38
- package/dist/types/common/harvest/harvest.d.ts.map +1 -1
- package/dist/types/common/harvest/types.d.ts +100 -0
- package/dist/types/common/harvest/types.d.ts.map +1 -0
- package/dist/types/common/session/session-entity.d.ts +6 -6
- package/dist/types/common/unload/eol.d.ts.map +1 -1
- package/dist/types/common/util/submit-data.d.ts +44 -64
- package/dist/types/common/util/submit-data.d.ts.map +1 -1
- package/dist/types/common/window/nreum.d.ts +2 -2
- package/dist/types/common/wrap/wrap-jsonp.d.ts.map +1 -1
- package/dist/types/features/ajax/aggregate/index.d.ts +5 -5
- package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/ajax/instrument/index.d.ts.map +1 -1
- package/dist/types/features/jserrors/aggregate/index.d.ts +1 -1
- package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/jserrors/constants.d.ts +0 -1
- package/dist/types/features/jserrors/constants.d.ts.map +1 -1
- package/dist/types/features/jserrors/instrument/index.d.ts +0 -13
- package/dist/types/features/jserrors/instrument/index.d.ts.map +1 -1
- package/dist/types/features/jserrors/instrument/uncaught-error.d.ts +15 -0
- package/dist/types/features/jserrors/instrument/uncaught-error.d.ts.map +1 -0
- package/dist/types/features/metrics/aggregate/endpoint-map.d.ts +5 -5
- package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_view_event/aggregate/initialized-features.d.ts.map +1 -1
- package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_replay/aggregate/index.d.ts +16 -30
- package/dist/types/features/session_replay/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_trace/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/utils/instrument-base.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/loaders/agent-base.d.ts +59 -0
- package/dist/types/loaders/agent-base.d.ts.map +1 -0
- package/dist/types/loaders/agent.d.ts +39 -5
- package/dist/types/loaders/agent.d.ts.map +1 -1
- package/dist/types/loaders/api/interaction-types.d.ts +122 -0
- package/dist/types/loaders/api/interaction-types.d.ts.map +1 -0
- package/dist/types/loaders/configure/configure.d.ts.map +1 -1
- package/dist/types/loaders/features/features.d.ts +9 -9
- package/dist/types/loaders/micro-agent.d.ts +6 -6
- package/dist/types/loaders/micro-agent.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/common/config/__mocks__/config.js +11 -0
- package/src/common/config/state/init.js +2 -1
- package/src/common/config/state/runtime.js +3 -2
- package/src/common/constants/__mocks__/env.js +3 -0
- package/src/common/constants/__mocks__/runtime.js +8 -0
- package/src/common/constants/env.cdn.test.js +7 -0
- package/src/common/constants/env.npm.test.js +7 -0
- package/src/common/constants/env.test.js +7 -0
- package/src/common/constants/runtime.js +71 -0
- package/src/common/constants/runtime.test.js +168 -0
- package/src/common/context/__mocks__/shared-context.js +8 -0
- package/src/common/deny-list/deny-list.js +11 -11
- package/src/common/deny-list/deny-list.test.js +31 -0
- package/src/common/event-listener/__mocks__/event-listener-opts.js +7 -0
- package/src/common/event-listener/event-listener-opts.js +1 -1
- package/src/common/harvest/__mocks__/harvest.js +13 -0
- package/src/common/harvest/harvest-scheduler.js +21 -20
- package/src/common/harvest/harvest-scheduler.test.js +496 -0
- package/src/common/harvest/harvest.js +142 -134
- package/src/common/harvest/harvest.test.js +798 -0
- package/src/common/harvest/types.js +47 -0
- package/src/common/ids/id.js +1 -1
- package/src/common/ids/unique-id.js +1 -1
- package/src/common/session/__mocks__/session-entity.js +25 -0
- package/src/common/session/session-entity.component-test.js +1 -1
- package/src/common/session/session-entity.js +1 -1
- package/src/common/timer/interaction-timer.js +1 -1
- package/src/common/timing/__mocks__/now.js +1 -0
- package/src/common/unload/__mocks__/eol.js +1 -0
- package/src/common/unload/eol.js +1 -2
- package/src/common/url/__mocks__/clean-url.js +1 -0
- package/src/common/url/__mocks__/encode.js +7 -0
- package/src/common/url/__mocks__/location.js +1 -0
- package/src/common/url/canonicalize-url.js +1 -1
- package/src/common/url/canonicalize-url.test.js +2 -2
- package/src/common/url/parse-url.js +1 -1
- package/src/common/url/parse-url.test.js +3 -3
- package/src/common/url/protocol.js +1 -1
- package/src/common/util/__mocks__/obfuscate.js +10 -0
- package/src/common/util/__mocks__/stringify.js +1 -0
- package/src/common/util/__mocks__/submit-data.js +5 -0
- package/src/common/util/__mocks__/traverse.js +1 -0
- package/src/common/util/submit-data.js +22 -58
- package/src/common/util/submit-data.test.js +30 -73
- package/src/common/window/nreum.js +1 -1
- package/src/common/wrap/wrap-events.js +1 -1
- package/src/common/wrap/wrap-fetch.js +1 -1
- package/src/common/wrap/wrap-history.js +1 -1
- package/src/common/wrap/wrap-jsonp.js +12 -7
- package/src/common/wrap/wrap-mutation.js +1 -1
- package/src/common/wrap/wrap-promise.js +1 -1
- package/src/common/wrap/wrap-promise.test.js +2 -2
- package/src/common/wrap/wrap-raf.js +1 -1
- package/src/common/wrap/wrap-timer.js +1 -1
- package/src/common/wrap/wrap-xhr.js +1 -1
- package/src/features/ajax/aggregate/index.js +26 -32
- package/src/features/ajax/instrument/distributed-tracing.js +1 -1
- package/src/features/ajax/instrument/index.js +1 -2
- package/src/features/jserrors/aggregate/compute-stack-trace.js +1 -1
- package/src/features/jserrors/aggregate/compute-stack-trace.test.js +1 -1
- package/src/features/jserrors/aggregate/index.js +7 -3
- package/src/features/jserrors/constants.js +0 -1
- package/src/features/jserrors/instrument/index.js +92 -88
- package/src/features/jserrors/instrument/uncaught-error.js +15 -0
- package/src/features/metrics/aggregate/framework-detection.js +1 -1
- package/src/features/metrics/aggregate/framework-detection.test.js +2 -2
- package/src/features/metrics/aggregate/index.js +1 -1
- package/src/features/page_action/aggregate/index.js +1 -1
- package/src/features/page_view_event/aggregate/index.js +1 -2
- package/src/features/page_view_event/aggregate/initialized-features.js +18 -14
- package/src/features/page_view_event/instrument/index.js +1 -1
- package/src/features/page_view_timing/aggregate/index.js +2 -4
- package/src/features/page_view_timing/instrument/index.js +1 -1
- package/src/features/session_replay/aggregate/index.component-test.js +17 -56
- package/src/features/session_replay/aggregate/index.js +47 -28
- package/src/features/session_replay/replay-mode.js +2 -2
- package/src/features/session_trace/aggregate/index.js +3 -4
- package/src/features/session_trace/instrument/index.js +1 -1
- package/src/features/spa/aggregate/index.js +1 -1
- package/src/features/spa/instrument/index.js +1 -1
- package/src/features/utils/agent-session.test.js +2 -2
- package/src/features/utils/instrument-base.js +11 -14
- package/src/features/utils/instrument-base.test.js +29 -3
- package/src/index.js +1 -3
- package/src/loaders/agent-base.js +81 -0
- package/src/loaders/agent.js +50 -1
- package/src/loaders/api/api.js +2 -2
- package/src/loaders/api/apiAsync.js +3 -3
- package/src/loaders/api/interaction-types.js +80 -0
- package/src/loaders/configure/configure.js +5 -4
- package/src/loaders/micro-agent.js +30 -31
- package/dist/cjs/common/browser-version/firefox-version.js +0 -17
- package/dist/cjs/common/browser-version/ios-version.js +0 -19
- package/dist/cjs/common/event-emitter/contextual-ee.test.js +0 -282
- package/dist/cjs/common/event-emitter/handle.test.js +0 -58
- package/dist/cjs/common/event-emitter/register-handler.test.js +0 -55
- package/dist/cjs/common/harvest/harvest-scheduler.component-test.js +0 -39
- package/dist/cjs/common/harvest/harvest.component-test.js +0 -224
- package/dist/cjs/common/ids/id.test.js +0 -85
- package/dist/cjs/common/ids/unique-id.test.js +0 -49
- package/dist/cjs/common/session/session-entity.component-test.js +0 -497
- package/dist/cjs/common/storage/local-storage.test.js +0 -14
- package/dist/cjs/common/timer/interaction-timer.component-test.js +0 -216
- package/dist/cjs/common/timer/timer.test.js +0 -105
- package/dist/cjs/common/timing/nav-timing.test.js +0 -192
- package/dist/cjs/common/url/canonicalize-url.test.js +0 -38
- package/dist/cjs/common/url/clean-url.test.js +0 -9
- package/dist/cjs/common/url/encode.component-test.js +0 -74
- package/dist/cjs/common/url/location.test.js +0 -13
- package/dist/cjs/common/url/parse-url.test.js +0 -111
- package/dist/cjs/common/url/protocol.component-test.js +0 -15
- package/dist/cjs/common/util/console.test.js +0 -30
- package/dist/cjs/common/util/data-size.test.js +0 -64
- package/dist/cjs/common/util/feature-flags.test.js +0 -84
- package/dist/cjs/common/util/get-or-set.test.js +0 -47
- package/dist/cjs/common/util/global-scope.js +0 -27
- package/dist/cjs/common/util/global-scope.test.js +0 -72
- package/dist/cjs/common/util/invoke.test.js +0 -49
- package/dist/cjs/common/util/map-own.test.js +0 -49
- package/dist/cjs/common/util/obfuscate.component-test.js +0 -129
- package/dist/cjs/common/util/stringify.test.js +0 -48
- package/dist/cjs/common/util/submit-data.test.js +0 -245
- package/dist/cjs/common/util/traverse.test.js +0 -44
- package/dist/cjs/common/wrap/wrap-promise.test.js +0 -119
- package/dist/cjs/features/jserrors/aggregate/canonical-function-name.test.js +0 -31
- package/dist/cjs/features/jserrors/aggregate/compute-stack-trace.test.js +0 -383
- package/dist/cjs/features/jserrors/aggregate/format-stack-trace.test.js +0 -40
- package/dist/cjs/features/jserrors/aggregate/string-hash-code.test.js +0 -27
- package/dist/cjs/features/jserrors/instrument/debug.js +0 -40
- package/dist/cjs/features/metrics/aggregate/framework-detection.test.js +0 -137
- package/dist/cjs/features/metrics/aggregate/polyfill-detection.es5.test.js +0 -17
- package/dist/cjs/features/metrics/aggregate/polyfill-detection.test.js +0 -165
- package/dist/cjs/features/session_replay/aggregate/index.component-test.js +0 -457
- package/dist/cjs/features/spa/aggregate/interaction-node.test.js +0 -16
- package/dist/cjs/features/utils/agent-session.test.js +0 -211
- package/dist/cjs/features/utils/aggregate-base.test.js +0 -110
- package/dist/cjs/features/utils/feature-base.test.js +0 -42
- package/dist/cjs/features/utils/handler-cache.test.js +0 -53
- package/dist/cjs/features/utils/instrument-base.test.js +0 -179
- package/dist/cjs/features/utils/lazy-feature-loader.test.js +0 -30
- package/dist/esm/common/browser-version/firefox-version.js +0 -10
- package/dist/esm/common/browser-version/ios-version.js +0 -11
- package/dist/esm/common/event-emitter/contextual-ee.test.js +0 -278
- package/dist/esm/common/event-emitter/handle.test.js +0 -54
- package/dist/esm/common/event-emitter/register-handler.test.js +0 -51
- package/dist/esm/common/harvest/harvest-scheduler.component-test.js +0 -37
- package/dist/esm/common/harvest/harvest.component-test.js +0 -222
- package/dist/esm/common/ids/id.test.js +0 -81
- package/dist/esm/common/ids/unique-id.test.js +0 -44
- package/dist/esm/common/session/session-entity.component-test.js +0 -495
- package/dist/esm/common/storage/local-storage.test.js +0 -12
- package/dist/esm/common/timer/interaction-timer.component-test.js +0 -214
- package/dist/esm/common/timer/timer.test.js +0 -103
- package/dist/esm/common/timing/nav-timing.test.js +0 -190
- package/dist/esm/common/url/canonicalize-url.test.js +0 -34
- package/dist/esm/common/url/clean-url.test.js +0 -7
- package/dist/esm/common/url/encode.component-test.js +0 -70
- package/dist/esm/common/url/location.test.js +0 -11
- package/dist/esm/common/url/parse-url.test.js +0 -107
- package/dist/esm/common/url/protocol.component-test.js +0 -13
- package/dist/esm/common/util/console.test.js +0 -28
- package/dist/esm/common/util/data-size.test.js +0 -60
- package/dist/esm/common/util/feature-flags.test.js +0 -80
- package/dist/esm/common/util/get-or-set.test.js +0 -45
- package/dist/esm/common/util/global-scope.js +0 -17
- package/dist/esm/common/util/global-scope.test.js +0 -70
- package/dist/esm/common/util/invoke.test.js +0 -47
- package/dist/esm/common/util/map-own.test.js +0 -47
- package/dist/esm/common/util/obfuscate.component-test.js +0 -125
- package/dist/esm/common/util/stringify.test.js +0 -46
- package/dist/esm/common/util/submit-data.test.js +0 -241
- package/dist/esm/common/util/traverse.test.js +0 -42
- package/dist/esm/common/wrap/wrap-promise.test.js +0 -115
- package/dist/esm/features/jserrors/aggregate/canonical-function-name.test.js +0 -29
- package/dist/esm/features/jserrors/aggregate/compute-stack-trace.test.js +0 -379
- package/dist/esm/features/jserrors/aggregate/format-stack-trace.test.js +0 -38
- package/dist/esm/features/jserrors/aggregate/string-hash-code.test.js +0 -25
- package/dist/esm/features/jserrors/instrument/debug.js +0 -38
- package/dist/esm/features/metrics/aggregate/framework-detection.test.js +0 -133
- package/dist/esm/features/metrics/aggregate/polyfill-detection.es5.test.js +0 -15
- package/dist/esm/features/metrics/aggregate/polyfill-detection.test.js +0 -163
- package/dist/esm/features/session_replay/aggregate/index.component-test.js +0 -453
- package/dist/esm/features/spa/aggregate/interaction-node.test.js +0 -14
- package/dist/esm/features/utils/agent-session.test.js +0 -207
- package/dist/esm/features/utils/aggregate-base.test.js +0 -108
- package/dist/esm/features/utils/feature-base.test.js +0 -40
- package/dist/esm/features/utils/handler-cache.test.js +0 -51
- package/dist/esm/features/utils/instrument-base.test.js +0 -175
- package/dist/esm/features/utils/lazy-feature-loader.test.js +0 -29
- package/dist/types/common/browser-version/firefox-version.d.ts +0 -2
- package/dist/types/common/browser-version/firefox-version.d.ts.map +0 -1
- package/dist/types/common/browser-version/ios-version.d.ts +0 -3
- package/dist/types/common/browser-version/ios-version.d.ts.map +0 -1
- package/dist/types/common/harvest/harvest-scheduler.component-test.d.ts +0 -2
- package/dist/types/common/harvest/harvest-scheduler.component-test.d.ts.map +0 -1
- package/dist/types/common/harvest/harvest.component-test.d.ts +0 -2
- package/dist/types/common/harvest/harvest.component-test.d.ts.map +0 -1
- package/dist/types/common/session/session-entity.component-test.d.ts +0 -2
- package/dist/types/common/session/session-entity.component-test.d.ts.map +0 -1
- package/dist/types/common/timer/interaction-timer.component-test.d.ts +0 -2
- package/dist/types/common/timer/interaction-timer.component-test.d.ts.map +0 -1
- package/dist/types/common/url/encode.component-test.d.ts +0 -2
- package/dist/types/common/url/encode.component-test.d.ts.map +0 -1
- package/dist/types/common/url/protocol.component-test.d.ts +0 -2
- package/dist/types/common/url/protocol.component-test.d.ts.map +0 -1
- package/dist/types/common/util/global-scope.d.ts +0 -5
- package/dist/types/common/util/global-scope.d.ts.map +0 -1
- package/dist/types/common/util/obfuscate.component-test.d.ts +0 -2
- package/dist/types/common/util/obfuscate.component-test.d.ts.map +0 -1
- package/dist/types/features/jserrors/instrument/debug.d.ts +0 -2
- package/dist/types/features/jserrors/instrument/debug.d.ts.map +0 -1
- package/dist/types/features/session_replay/aggregate/index.component-test.d.ts +0 -2
- package/dist/types/features/session_replay/aggregate/index.component-test.d.ts.map +0 -1
- package/src/common/browser-version/firefox-version.js +0 -10
- package/src/common/browser-version/ios-version.js +0 -11
- package/src/common/harvest/harvest-scheduler.component-test.js +0 -25
- package/src/common/harvest/harvest.component-test.js +0 -169
- package/src/common/util/global-scope.js +0 -23
- package/src/common/util/global-scope.test.js +0 -87
- package/src/features/jserrors/instrument/debug.js +0 -36
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.component-test.d.ts","sourceRoot":"","sources":["../../../../src/common/url/protocol.component-test.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"global-scope.d.ts","sourceRoot":"","sources":["../../../../src/common/util/global-scope.js"],"names":[],"mappings":"AAEA,qCAC2D;AAE3D,oCACgG;AAEhG,0CAYI;AAEJ,qCAAwD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"obfuscate.component-test.d.ts","sourceRoot":"","sources":["../../../../src/common/util/obfuscate.component-test.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../../../src/features/jserrors/instrument/debug.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.component-test.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/aggregate/index.component-test.js"],"names":[],"mappings":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/* eslint-disable no-useless-escape */
|
|
7
|
-
|
|
8
|
-
export var ffVersion = 0
|
|
9
|
-
var match = navigator.userAgent.match(/Firefox[\/\s](\d+\.\d+)/)
|
|
10
|
-
if (match) ffVersion = +match[1]
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export const isiOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent)
|
|
2
|
-
|
|
3
|
-
/* Feature detection to get our version(s). */
|
|
4
|
-
|
|
5
|
-
// Shared Web Workers introduced in iOS 16.0+ and n/a in 15.6-
|
|
6
|
-
export const iOS_below16 = isiOS && Boolean(typeof SharedWorker === 'undefined')
|
|
7
|
-
/*
|
|
8
|
-
^ It was discovered in Safari 14 (https://bugs.webkit.org/show_bug.cgi?id=225305) that the buffered flag in PerformanceObserver
|
|
9
|
-
did not work. This affects our onFCP metric in particular since web-vitals uses that flag to retrieve paint timing entries.
|
|
10
|
-
This was fixed in v16+.
|
|
11
|
-
*/
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { setConfiguration } from '../config/state/init'
|
|
2
|
-
import { HarvestScheduler } from './harvest-scheduler'
|
|
3
|
-
|
|
4
|
-
describe('runHarvest', () => {
|
|
5
|
-
test('should re-schedule harvest even if there is no accumulated data', () => {
|
|
6
|
-
setConfiguration('asdf', {})
|
|
7
|
-
const scheduler = new HarvestScheduler('events', { getPayload: jest.fn() }, { agentIdentifier: 'asdf', ee: { on: jest.fn() } })
|
|
8
|
-
scheduler.started = true
|
|
9
|
-
jest.spyOn(scheduler, 'scheduleHarvest')
|
|
10
|
-
scheduler.runHarvest()
|
|
11
|
-
expect(scheduler.opts.getPayload()).toBeFalsy()
|
|
12
|
-
expect(scheduler.scheduleHarvest).toHaveBeenCalledTimes(1)
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
test('should also re-schedule harvest if there is accumulated data', () => {
|
|
16
|
-
setConfiguration('asdf', {})
|
|
17
|
-
const scheduler = new HarvestScheduler('events', { getPayload: jest.fn().mockImplementation(() => 'payload') }, { agentIdentifier: 'asdf', ee: { on: jest.fn() } })
|
|
18
|
-
scheduler.started = true
|
|
19
|
-
scheduler.harvest._send = () => {}
|
|
20
|
-
jest.spyOn(scheduler, 'scheduleHarvest')
|
|
21
|
-
scheduler.runHarvest()
|
|
22
|
-
expect(scheduler.opts.getPayload()).toBeTruthy()
|
|
23
|
-
expect(scheduler.scheduleHarvest).toHaveBeenCalledTimes(1)
|
|
24
|
-
})
|
|
25
|
-
})
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { submitData } from '../util/submit-data'
|
|
2
|
-
import { Harvest } from './harvest'
|
|
3
|
-
|
|
4
|
-
jest.mock('../context/shared-context', () => ({
|
|
5
|
-
__esModule: true,
|
|
6
|
-
SharedContext: function () {
|
|
7
|
-
this.sharedContext = {
|
|
8
|
-
agentIdentifier: 'abcd'
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
}))
|
|
12
|
-
jest.mock('../config/config', () => ({
|
|
13
|
-
__esModule: true,
|
|
14
|
-
getConfigurationValue: jest.fn(),
|
|
15
|
-
getInfo: jest.fn().mockReturnValue({
|
|
16
|
-
errorBeacon: 'example.com',
|
|
17
|
-
licenseKey: 'abcd'
|
|
18
|
-
}),
|
|
19
|
-
getRuntime: jest.fn().mockReturnValue({
|
|
20
|
-
bytesSent: {},
|
|
21
|
-
queryBytesSent: {}
|
|
22
|
-
})
|
|
23
|
-
}))
|
|
24
|
-
jest.mock('../util/submit-data', () => ({
|
|
25
|
-
__esModule: true,
|
|
26
|
-
submitData: {
|
|
27
|
-
xhr: jest.fn(() => ({
|
|
28
|
-
addEventListener: jest.fn()
|
|
29
|
-
})),
|
|
30
|
-
beacon: jest.fn(),
|
|
31
|
-
img: jest.fn()
|
|
32
|
-
}
|
|
33
|
-
}))
|
|
34
|
-
|
|
35
|
-
describe('sendX', () => {
|
|
36
|
-
test.each([null, undefined, false])('should not send request when body is empty and sendEmptyBody is %s', (sendEmptyBody) => {
|
|
37
|
-
const sendCallback = jest.fn()
|
|
38
|
-
const harvester = new Harvest()
|
|
39
|
-
harvester.on('jserrors', () => ({
|
|
40
|
-
body: {},
|
|
41
|
-
qs: {}
|
|
42
|
-
}))
|
|
43
|
-
|
|
44
|
-
harvester.sendX({ endpoint: 'jserrors', cbFinished: sendCallback })
|
|
45
|
-
|
|
46
|
-
expect(sendCallback).toHaveBeenCalledWith({ sent: false })
|
|
47
|
-
expect(submitData.xhr).not.toHaveBeenCalled()
|
|
48
|
-
expect(submitData.img).not.toHaveBeenCalled()
|
|
49
|
-
expect(submitData.beacon).not.toHaveBeenCalled()
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
test('should send request when body is empty and sendEmptyBody is true', () => {
|
|
53
|
-
const harvester = new Harvest()
|
|
54
|
-
harvester.on('jserrors', () => ({
|
|
55
|
-
body: {},
|
|
56
|
-
qs: {}
|
|
57
|
-
}))
|
|
58
|
-
|
|
59
|
-
harvester.sendX({ endpoint: 'jserrors', opts: { sendEmptyBody: true }, cbFinished: jest.fn() })
|
|
60
|
-
|
|
61
|
-
expect(submitData.xhr).toHaveBeenCalledWith(expect.objectContaining({
|
|
62
|
-
url: expect.stringContaining('https://example.com/jserrors/1/abcd?'),
|
|
63
|
-
body: undefined
|
|
64
|
-
}))
|
|
65
|
-
expect(submitData.img).not.toHaveBeenCalled()
|
|
66
|
-
expect(submitData.beacon).not.toHaveBeenCalled()
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
test.each([null, undefined, []])('should remove %s values from the body and query string when sending', (emptyValue) => {
|
|
70
|
-
const harvester = new Harvest()
|
|
71
|
-
harvester.on('jserrors', () => ({
|
|
72
|
-
body: { bar: 'foo', empty: emptyValue },
|
|
73
|
-
qs: { foo: 'bar', empty: emptyValue }
|
|
74
|
-
}))
|
|
75
|
-
|
|
76
|
-
harvester.sendX({ endpoint: 'jserrors', cbFinished: jest.fn() })
|
|
77
|
-
|
|
78
|
-
expect(submitData.xhr).toHaveBeenCalledWith(expect.objectContaining({
|
|
79
|
-
url: expect.stringContaining('&foo=bar'),
|
|
80
|
-
body: JSON.stringify({ bar: 'foo' })
|
|
81
|
-
}))
|
|
82
|
-
expect(submitData.xhr).toHaveBeenCalledWith(expect.objectContaining({
|
|
83
|
-
url: expect.not.stringContaining('&empty'),
|
|
84
|
-
body: expect.not.stringContaining('empty')
|
|
85
|
-
}))
|
|
86
|
-
expect(submitData.img).not.toHaveBeenCalled()
|
|
87
|
-
expect(submitData.beacon).not.toHaveBeenCalled()
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
test.each([1, false, true])('should not remove value %s (when it doesn\'t have a length) from the body and query string when sending', (nonStringValue) => {
|
|
91
|
-
const harvester = new Harvest()
|
|
92
|
-
harvester.on('jserrors', () => ({
|
|
93
|
-
body: { bar: 'foo', nonString: nonStringValue },
|
|
94
|
-
qs: { foo: 'bar', nonString: nonStringValue }
|
|
95
|
-
}))
|
|
96
|
-
|
|
97
|
-
harvester.sendX({ endpoint: 'jserrors', cbFinished: jest.fn() })
|
|
98
|
-
|
|
99
|
-
expect(submitData.xhr).toHaveBeenCalledWith(expect.objectContaining({
|
|
100
|
-
url: expect.stringContaining(`&nonString=${nonStringValue}`),
|
|
101
|
-
body: JSON.stringify({ bar: 'foo', nonString: nonStringValue })
|
|
102
|
-
}))
|
|
103
|
-
expect(submitData.img).not.toHaveBeenCalled()
|
|
104
|
-
expect(submitData.beacon).not.toHaveBeenCalled()
|
|
105
|
-
})
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
describe('send', () => {
|
|
109
|
-
test.each([null, undefined, false])('should not send request when body is empty and sendEmptyBody is %s', (sendEmptyBody) => {
|
|
110
|
-
const sendCallback = jest.fn()
|
|
111
|
-
const harvester = new Harvest()
|
|
112
|
-
|
|
113
|
-
harvester.send({ endpoint: 'rum', payload: { qs: {}, body: {} }, opts: { sendEmptyBody }, cbFinished: sendCallback })
|
|
114
|
-
|
|
115
|
-
expect(sendCallback).toHaveBeenCalledWith({ sent: false })
|
|
116
|
-
expect(submitData.xhr).not.toHaveBeenCalled()
|
|
117
|
-
expect(submitData.img).not.toHaveBeenCalled()
|
|
118
|
-
expect(submitData.beacon).not.toHaveBeenCalled()
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
test('should send request when body is empty and sendEmptyBody is true', () => {
|
|
122
|
-
const harvester = new Harvest()
|
|
123
|
-
|
|
124
|
-
harvester.send({ endpoint: 'rum', payload: { qs: {}, body: {} }, opts: { sendEmptyBody: true } })
|
|
125
|
-
|
|
126
|
-
expect(submitData.xhr).toHaveBeenCalledWith(expect.objectContaining({
|
|
127
|
-
url: expect.stringContaining('https://example.com/1/abcd?'),
|
|
128
|
-
body: undefined
|
|
129
|
-
}))
|
|
130
|
-
expect(submitData.img).not.toHaveBeenCalled()
|
|
131
|
-
expect(submitData.beacon).not.toHaveBeenCalled()
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
test.each([null, undefined, []])('should remove %s values from the body and query string when sending', (emptyValue) => {
|
|
135
|
-
const harvester = new Harvest()
|
|
136
|
-
|
|
137
|
-
harvester.send({
|
|
138
|
-
endpoint: 'rum',
|
|
139
|
-
payload: { qs: { foo: 'bar', empty: emptyValue }, body: { bar: 'foo', empty: emptyValue } }
|
|
140
|
-
})
|
|
141
|
-
|
|
142
|
-
expect(submitData.xhr).toHaveBeenCalledWith(expect.objectContaining({
|
|
143
|
-
url: expect.stringContaining('&foo=bar'),
|
|
144
|
-
body: JSON.stringify({ bar: 'foo' })
|
|
145
|
-
}))
|
|
146
|
-
expect(submitData.xhr).toHaveBeenCalledWith(expect.objectContaining({
|
|
147
|
-
url: expect.not.stringContaining('&empty'),
|
|
148
|
-
body: expect.not.stringContaining('empty')
|
|
149
|
-
}))
|
|
150
|
-
expect(submitData.img).not.toHaveBeenCalled()
|
|
151
|
-
expect(submitData.beacon).not.toHaveBeenCalled()
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
test.each([1, false, true])('should not remove value %s (when it doesn\'t have a length) from the body and query string when sending', (nonStringValue) => {
|
|
155
|
-
const harvester = new Harvest()
|
|
156
|
-
|
|
157
|
-
harvester.send({
|
|
158
|
-
endpoint: 'rum',
|
|
159
|
-
payload: { qs: { foo: 'bar', nonString: nonStringValue }, body: { bar: 'foo', nonString: nonStringValue } }
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
expect(submitData.xhr).toHaveBeenCalledWith(expect.objectContaining({
|
|
163
|
-
url: expect.stringContaining(`&nonString=${nonStringValue}`),
|
|
164
|
-
body: JSON.stringify({ bar: 'foo', nonString: nonStringValue })
|
|
165
|
-
}))
|
|
166
|
-
expect(submitData.img).not.toHaveBeenCalled()
|
|
167
|
-
expect(submitData.beacon).not.toHaveBeenCalled()
|
|
168
|
-
})
|
|
169
|
-
})
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/* global globalThis, WorkerGlobalScope, WorkerNavigator */
|
|
2
|
-
|
|
3
|
-
export const isBrowserScope =
|
|
4
|
-
Boolean(typeof window !== 'undefined' && window.document)
|
|
5
|
-
|
|
6
|
-
export const isWorkerScope =
|
|
7
|
-
Boolean(typeof WorkerGlobalScope !== 'undefined' && self.navigator instanceof WorkerNavigator)
|
|
8
|
-
|
|
9
|
-
export let globalScope = (() => {
|
|
10
|
-
if (isBrowserScope) {
|
|
11
|
-
return window
|
|
12
|
-
} else if (isWorkerScope) {
|
|
13
|
-
if (typeof globalThis !== 'undefined' && globalThis instanceof WorkerGlobalScope) {
|
|
14
|
-
return globalThis
|
|
15
|
-
} else if (self instanceof WorkerGlobalScope) {
|
|
16
|
-
return self
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
throw new Error('New Relic browser agent shutting down due to error: Unable to locate global scope. This is possibly due to code redefining browser global variables like "self" and "window".')
|
|
21
|
-
})()
|
|
22
|
-
|
|
23
|
-
export const initialLocation = '' + globalScope.location
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
The global-scope module contains exports that are defined once at the time
|
|
3
|
-
of importing the module. For this reason, the module must be dynamically
|
|
4
|
-
imported in each test case.
|
|
5
|
-
|
|
6
|
-
A scope must always exist or importing the module will throw an error. Use
|
|
7
|
-
`enableWorkerScope` to enable the worker scope. Be sure to call `disableWorkerScope`
|
|
8
|
-
before any calls to `expect` or the test will fail with an error from Jest.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { faker } from '@faker-js/faker'
|
|
12
|
-
|
|
13
|
-
afterEach(() => {
|
|
14
|
-
jest.restoreAllMocks()
|
|
15
|
-
jest.resetModules()
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
test('should indicate a browser scope', async () => {
|
|
19
|
-
jest.spyOn(global, 'window', 'get').mockReturnValue({ document: {} })
|
|
20
|
-
|
|
21
|
-
const globalScopeModule = await import('./global-scope')
|
|
22
|
-
|
|
23
|
-
expect(globalScopeModule.isBrowserScope).toBe(true)
|
|
24
|
-
expect(globalScopeModule.isWorkerScope).toBe(false)
|
|
25
|
-
expect(globalScopeModule.globalScope).toBe(global.window)
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
test('should indicate a worker scope', async () => {
|
|
29
|
-
enableWorkerScope()
|
|
30
|
-
const globalScopeModule = await import('./global-scope')
|
|
31
|
-
const mockedGlobalThis = global.globalThis
|
|
32
|
-
disableWorkerScope()
|
|
33
|
-
|
|
34
|
-
expect(globalScopeModule.isBrowserScope).toBe(false)
|
|
35
|
-
expect(globalScopeModule.isWorkerScope).toBe(true)
|
|
36
|
-
expect(globalScopeModule.globalScope).toBe(mockedGlobalThis)
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
test('should return the self global', async () => {
|
|
40
|
-
enableWorkerScope()
|
|
41
|
-
jest.replaceProperty(global, 'globalThis', null)
|
|
42
|
-
jest.spyOn(global, 'self', 'get').mockReturnValue(new global.WorkerGlobalScope())
|
|
43
|
-
|
|
44
|
-
const globalScopeModule = await import('./global-scope')
|
|
45
|
-
const mockedGlobalSelf = global.self
|
|
46
|
-
disableWorkerScope()
|
|
47
|
-
|
|
48
|
-
expect(globalScopeModule.isBrowserScope).toBe(false)
|
|
49
|
-
expect(globalScopeModule.isWorkerScope).toBe(true)
|
|
50
|
-
expect(globalScopeModule.globalScope).toBe(mockedGlobalSelf)
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
test('should throw an error when a scope cannot be defined', async () => {
|
|
54
|
-
jest.spyOn(global, 'window', 'get').mockReturnValue(undefined)
|
|
55
|
-
|
|
56
|
-
await expect(() => import('./global-scope')).rejects.toThrow()
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
test('should immediately store the current location', async () => {
|
|
60
|
-
const url = faker.internet.url()
|
|
61
|
-
jest.spyOn(window, 'location', 'get').mockReturnValue(url)
|
|
62
|
-
|
|
63
|
-
const globalScopeModule = await import('./global-scope')
|
|
64
|
-
|
|
65
|
-
expect(globalScopeModule.initialLocation).toBe(url)
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
function enableWorkerScope () {
|
|
69
|
-
jest.spyOn(global, 'window', 'get').mockReturnValue(undefined)
|
|
70
|
-
|
|
71
|
-
class WorkerNavigator {}
|
|
72
|
-
class WorkerGlobalScope {
|
|
73
|
-
navigator = new WorkerNavigator()
|
|
74
|
-
}
|
|
75
|
-
global.WorkerGlobalScope = WorkerGlobalScope
|
|
76
|
-
global.WorkerNavigator = WorkerNavigator
|
|
77
|
-
|
|
78
|
-
jest.spyOn(global, 'navigator', 'get').mockReturnValue(new global.WorkerNavigator())
|
|
79
|
-
jest.replaceProperty(global, 'globalThis', new WorkerGlobalScope())
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function disableWorkerScope () {
|
|
83
|
-
delete global.WorkerGlobalScope
|
|
84
|
-
delete global.WorkerNavigator
|
|
85
|
-
|
|
86
|
-
jest.restoreAllMocks()
|
|
87
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { ee } from '../../../common/event-emitter/contextual-ee'
|
|
7
|
-
import { mapOwn } from '../../../common/util/map-own'
|
|
8
|
-
|
|
9
|
-
var flags = {}
|
|
10
|
-
var flagArr
|
|
11
|
-
|
|
12
|
-
try {
|
|
13
|
-
flagArr = localStorage.getItem('__nr_flags').split(',')
|
|
14
|
-
if (console && typeof console.log === 'function') {
|
|
15
|
-
flags.console = true
|
|
16
|
-
if (flagArr.indexOf('dev') !== -1) flags.dev = true
|
|
17
|
-
if (flagArr.indexOf('nr_dev') !== -1) flags.nrDev = true
|
|
18
|
-
}
|
|
19
|
-
} catch (err) {
|
|
20
|
-
// no op
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (flags.nrDev) ee.on('internal-error', function (err) { log(err.stack) })
|
|
24
|
-
if (flags.dev) ee.on('fn-err', function (args, origThis, err) { log(err.stack) })
|
|
25
|
-
if (flags.dev) {
|
|
26
|
-
log('NR AGENT IN DEVELOPMENT MODE')
|
|
27
|
-
log('flags: ' + mapOwn(flags, function (key, val) { return key }).join(', '))
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function log (message) {
|
|
31
|
-
try {
|
|
32
|
-
if (flags.console) log(message)
|
|
33
|
-
} catch (err) {
|
|
34
|
-
// no op
|
|
35
|
-
}
|
|
36
|
-
}
|