@newrelic/browser-agent 1.270.1 → 1.270.2

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 CHANGED
@@ -3,6 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.270.2](https://github.com/newrelic/newrelic-browser-agent/compare/v1.270.1...v1.270.2) (2024-10-28)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Correct naming for logging pageUrl attribute ([#1225](https://github.com/newrelic/newrelic-browser-agent/issues/1225)) ([95f5a77](https://github.com/newrelic/newrelic-browser-agent/commit/95f5a77c60221c0eda61a42f33648f5a2791891f))
12
+
6
13
  ## [1.270.1](https://github.com/newrelic/newrelic-browser-agent/compare/v1.270.0...v1.270.1) (2024-10-23)
7
14
 
8
15
 
@@ -27,7 +27,6 @@ const model = {
27
27
  loaderType: undefined,
28
28
  maxBytes: 30000,
29
29
  onerror: undefined,
30
- origin: '' + _runtime.globalScope.location,
31
30
  ptid: undefined,
32
31
  releaseIds: {},
33
32
  /** Agent-specific metadata found in the RUM call response. ex. entityGuid */
@@ -12,7 +12,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.DIST_METHOD = exports.BUILD_EN
12
12
  /**
13
13
  * Exposes the version of the agent
14
14
  */
15
- const VERSION = exports.VERSION = "1.270.1";
15
+ const VERSION = exports.VERSION = "1.270.2";
16
16
 
17
17
  /**
18
18
  * Exposes the build type of the agent
@@ -12,7 +12,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.DIST_METHOD = exports.BUILD_EN
12
12
  /**
13
13
  * Exposes the version of the agent
14
14
  */
15
- const VERSION = exports.VERSION = "1.270.1";
15
+ const VERSION = exports.VERSION = "1.270.2";
16
16
 
17
17
  /**
18
18
  * Exposes the build type of the agent
@@ -29,7 +29,7 @@ class Log {
29
29
  this.message = message;
30
30
  this.attributes = {
31
31
  ...attributes,
32
- pageUrl: (0, _cleanUrl.cleanURL)('' + _runtime.globalScope.location)
32
+ pageUrl: (0, _cleanUrl.cleanURL)('' + _runtime.initialLocation)
33
33
  };
34
34
  this.level = level.toUpperCase();
35
35
  }
@@ -56,8 +56,8 @@ class Aggregate extends _aggregateBase.AggregateBase {
56
56
  constructor(agentRef) {
57
57
  super(agentRef, FEATURE_NAME);
58
58
  this.state = {
59
- initialPageURL: agentRef.runtime.origin,
60
- lastSeenUrl: agentRef.runtime.origin,
59
+ initialPageURL: _runtime.initialLocation,
60
+ lastSeenUrl: _runtime.initialLocation,
61
61
  lastSeenRouteName: null,
62
62
  timerMap: {},
63
63
  timerBudget: MAX_TIMER_BUDGET,
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Interaction = Interaction;
7
7
  var _info = require("../../../common/config/info");
8
- var _runtime = require("../../../common/config/runtime");
8
+ var _runtime = require("../../../common/constants/runtime");
9
9
  var _nreum = require("../../../common/window/nreum");
10
10
  var _contextualEe = require("../../../common/event-emitter/contextual-ee");
11
11
  var _interactionNode = require("./interaction-node");
@@ -34,7 +34,7 @@ function Interaction(eventName, timestamp, url, routeName, onFinished, agentIden
34
34
  var root = this.root = new _interactionNode.InteractionNode(this, null, 'interaction', timestamp);
35
35
  var attrs = root.attrs;
36
36
  attrs.trigger = eventName;
37
- attrs.initialPageURL = (0, _runtime.getRuntime)(agentIdentifier).origin;
37
+ attrs.initialPageURL = _runtime.initialLocation;
38
38
  attrs.oldRoute = routeName;
39
39
  attrs.newURL = attrs.oldURL = url;
40
40
  attrs.custom = {};
@@ -1,6 +1,6 @@
1
1
  import { getModeledObject } from './configurable';
2
2
  import { getNREUMInitializedAgent } from '../window/nreum';
3
- import { globalScope, originTime } from '../constants/runtime';
3
+ import { originTime } from '../constants/runtime';
4
4
  import { BUILD_ENV, DIST_METHOD, VERSION } from "../constants/env.npm";
5
5
 
6
6
  /**
@@ -21,7 +21,6 @@ const model = {
21
21
  loaderType: undefined,
22
22
  maxBytes: 30000,
23
23
  onerror: undefined,
24
- origin: '' + globalScope.location,
25
24
  ptid: undefined,
26
25
  releaseIds: {},
27
26
  /** Agent-specific metadata found in the RUM call response. ex. entityGuid */
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * Exposes the version of the agent
8
8
  */
9
- export const VERSION = "1.270.1";
9
+ export const VERSION = "1.270.2";
10
10
 
11
11
  /**
12
12
  * Exposes the build type of the agent
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * Exposes the version of the agent
8
8
  */
9
- export const VERSION = "1.270.1";
9
+ export const VERSION = "1.270.2";
10
10
 
11
11
  /**
12
12
  * Exposes the build type of the agent
@@ -1,4 +1,4 @@
1
- import { globalScope } from '../../../common/constants/runtime';
1
+ import { initialLocation } from '../../../common/constants/runtime';
2
2
  import { cleanURL } from '../../../common/url/clean-url';
3
3
  import { LOG_LEVELS } from '../constants';
4
4
  export class Log {
@@ -23,7 +23,7 @@ export class Log {
23
23
  this.message = message;
24
24
  this.attributes = {
25
25
  ...attributes,
26
- pageUrl: cleanURL('' + globalScope.location)
26
+ pageUrl: cleanURL('' + initialLocation)
27
27
  };
28
28
  this.level = level.toUpperCase();
29
29
  }
@@ -19,7 +19,7 @@ import { AggregateBase } from '../../utils/aggregate-base';
19
19
  import { firstContentfulPaint } from '../../../common/vitals/first-contentful-paint';
20
20
  import { firstPaint } from '../../../common/vitals/first-paint';
21
21
  import { bundleId } from '../../../common/ids/bundle-id';
22
- import { loadedAsDeferredBrowserScript } from '../../../common/constants/runtime';
22
+ import { initialLocation, loadedAsDeferredBrowserScript } from '../../../common/constants/runtime';
23
23
  import { handle } from '../../../common/event-emitter/handle';
24
24
  import { SUPPORTABILITY_METRIC_CHANNEL } from '../../metrics/constants';
25
25
  import { warn } from '../../../common/util/console';
@@ -47,8 +47,8 @@ export class Aggregate extends AggregateBase {
47
47
  constructor(agentRef) {
48
48
  super(agentRef, FEATURE_NAME);
49
49
  this.state = {
50
- initialPageURL: agentRef.runtime.origin,
51
- lastSeenUrl: agentRef.runtime.origin,
50
+ initialPageURL: initialLocation,
51
+ lastSeenUrl: initialLocation,
52
52
  lastSeenRouteName: null,
53
53
  timerMap: {},
54
54
  timerBudget: MAX_TIMER_BUDGET,
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { getInfo } from '../../../common/config/info';
7
- import { getRuntime } from '../../../common/config/runtime';
7
+ import { initialLocation } from '../../../common/constants/runtime';
8
8
  import { gosNREUMOriginals } from '../../../common/window/nreum';
9
9
  import { ee } from '../../../common/event-emitter/contextual-ee';
10
10
  import { InteractionNode } from './interaction-node';
@@ -28,7 +28,7 @@ export function Interaction(eventName, timestamp, url, routeName, onFinished, ag
28
28
  var root = this.root = new InteractionNode(this, null, 'interaction', timestamp);
29
29
  var attrs = root.attrs;
30
30
  attrs.trigger = eventName;
31
- attrs.initialPageURL = getRuntime(agentIdentifier).origin;
31
+ attrs.initialPageURL = initialLocation;
32
32
  attrs.oldRoute = routeName;
33
33
  attrs.newURL = attrs.oldURL = url;
34
34
  attrs.custom = {};
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/common/config/runtime.js"],"names":[],"mappings":"AAsCA,yCAIC;AAED,oDAgBC"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/common/config/runtime.js"],"names":[],"mappings":"AAqCA,yCAIC;AAED,oDAgBC"}
@@ -2,8 +2,8 @@ export class Aggregate extends AggregateBase {
2
2
  static featureName: string;
3
3
  constructor(agentRef: any);
4
4
  state: {
5
- initialPageURL: any;
6
- lastSeenUrl: any;
5
+ initialPageURL: string;
6
+ lastSeenUrl: string;
7
7
  lastSeenRouteName: null;
8
8
  timerMap: {};
9
9
  timerBudget: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.270.1",
3
+ "version": "1.270.2",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -1,6 +1,6 @@
1
1
  import { getModeledObject } from './configurable'
2
2
  import { getNREUMInitializedAgent } from '../window/nreum'
3
- import { globalScope, originTime } from '../constants/runtime'
3
+ import { originTime } from '../constants/runtime'
4
4
  import { BUILD_ENV, DIST_METHOD, VERSION } from '../constants/env'
5
5
 
6
6
  /**
@@ -23,7 +23,6 @@ const model = {
23
23
  loaderType: undefined,
24
24
  maxBytes: 30000,
25
25
  onerror: undefined,
26
- origin: '' + globalScope.location,
27
26
  ptid: undefined,
28
27
  releaseIds: {},
29
28
  /** Agent-specific metadata found in the RUM call response. ex. entityGuid */
@@ -1,4 +1,4 @@
1
- import { globalScope } from '../../../common/constants/runtime'
1
+ import { initialLocation } from '../../../common/constants/runtime'
2
2
  import { cleanURL } from '../../../common/url/clean-url'
3
3
  import { LOG_LEVELS } from '../constants'
4
4
 
@@ -22,7 +22,7 @@ export class Log {
22
22
  /** @type {long} */
23
23
  this.timestamp = timestamp
24
24
  this.message = message
25
- this.attributes = { ...attributes, pageUrl: cleanURL('' + globalScope.location) }
25
+ this.attributes = { ...attributes, pageUrl: cleanURL('' + initialLocation) }
26
26
  this.level = level.toUpperCase()
27
27
  }
28
28
  }
@@ -19,7 +19,7 @@ import { AggregateBase } from '../../utils/aggregate-base'
19
19
  import { firstContentfulPaint } from '../../../common/vitals/first-contentful-paint'
20
20
  import { firstPaint } from '../../../common/vitals/first-paint'
21
21
  import { bundleId } from '../../../common/ids/bundle-id'
22
- import { loadedAsDeferredBrowserScript } from '../../../common/constants/runtime'
22
+ import { initialLocation, loadedAsDeferredBrowserScript } from '../../../common/constants/runtime'
23
23
  import { handle } from '../../../common/event-emitter/handle'
24
24
  import { SUPPORTABILITY_METRIC_CHANNEL } from '../../metrics/constants'
25
25
  import { warn } from '../../../common/util/console'
@@ -35,8 +35,8 @@ export class Aggregate extends AggregateBase {
35
35
  super(agentRef, FEATURE_NAME)
36
36
 
37
37
  this.state = {
38
- initialPageURL: agentRef.runtime.origin,
39
- lastSeenUrl: agentRef.runtime.origin,
38
+ initialPageURL: initialLocation,
39
+ lastSeenUrl: initialLocation,
40
40
  lastSeenRouteName: null,
41
41
  timerMap: {},
42
42
  timerBudget: MAX_TIMER_BUDGET,
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { getInfo } from '../../../common/config/info'
7
- import { getRuntime } from '../../../common/config/runtime'
7
+ import { initialLocation } from '../../../common/constants/runtime'
8
8
  import { gosNREUMOriginals } from '../../../common/window/nreum'
9
9
  import { ee } from '../../../common/event-emitter/contextual-ee'
10
10
  import { InteractionNode } from './interaction-node'
@@ -34,7 +34,7 @@ export function Interaction (eventName, timestamp, url, routeName, onFinished, a
34
34
  var attrs = root.attrs
35
35
 
36
36
  attrs.trigger = eventName
37
- attrs.initialPageURL = getRuntime(agentIdentifier).origin
37
+ attrs.initialPageURL = initialLocation
38
38
  attrs.oldRoute = routeName
39
39
  attrs.newURL = attrs.oldURL = url
40
40
  attrs.custom = {}