@newrelic/browser-agent 1.293.0-rc.1 → 1.293.0-rc.3

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.
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.DIST_METHOD = exports.BUILD_EN
17
17
  /**
18
18
  * Exposes the version of the agent
19
19
  */
20
- const VERSION = exports.VERSION = "1.293.0-rc.1";
20
+ const VERSION = exports.VERSION = "1.293.0-rc.3";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.DIST_METHOD = exports.BUILD_EN
17
17
  /**
18
18
  * Exposes the version of the agent
19
19
  */
20
- const VERSION = exports.VERSION = "1.293.0-rc.1";
20
+ const VERSION = exports.VERSION = "1.293.0-rc.3";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -14,10 +14,11 @@ var patternWithoutHash = /([^?#]*)().*/;
14
14
 
15
15
  /**
16
16
  * Cleans a URL by removing the query string and fragment (hash portion).
17
- * @param {string} url - The original URL to be cleaned.
17
+ * @param {string} [url] - The original URL to be cleaned.
18
18
  * @param {boolean} [keepHash=false] - Whether to preserve the hash portion of the URL.
19
19
  * @returns {string} The cleaned URL.
20
20
  */
21
21
  function cleanURL(url, keepHash) {
22
+ if (!url) return url;
22
23
  return url.replace(keepHash ? patternWithHash : patternWithoutHash, '$1$2');
23
24
  }
@@ -20,7 +20,8 @@ class InitialPageLoadInteraction extends _interaction.Interaction {
20
20
  super(agentRef, _constants.IPL_TRIGGER_NAME, 0, null);
21
21
  this.queueTime = agentRef.info.queueTime;
22
22
  this.appTime = agentRef.info.applicationTime;
23
- this.oldURL = document.referrer;
23
+ /** @type {string|undefined} we assign as undefined if no referrer value is available so that URL grouping is not applied to an empty string at ingest */
24
+ this.oldURL = document.referrer || undefined;
24
25
  }
25
26
  get firstPaint() {
26
27
  return _firstPaint.firstPaint.current.value;
@@ -34,7 +34,7 @@ function Interaction(eventName, timestamp, url, routeName, onFinished, agentRef)
34
34
  attrs.initialPageURL = _runtime.initialLocation;
35
35
  attrs.oldRoute = routeName;
36
36
  attrs.newURL = url;
37
- attrs.oldURL = eventName === 'initialPageLoad' ? document.referrer : url;
37
+ attrs.oldURL = eventName === 'initialPageLoad' ? document.referrer || undefined : url; // document referrer can return '' and flipper url grouping gets weird with empty strings. Pass undefined to skip flipper.
38
38
  attrs.custom = {};
39
39
  attrs.store = {};
40
40
  }
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.293.0-rc.1";
14
+ export const VERSION = "1.293.0-rc.3";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.293.0-rc.1";
14
+ export const VERSION = "1.293.0-rc.3";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -8,10 +8,11 @@ var patternWithoutHash = /([^?#]*)().*/;
8
8
 
9
9
  /**
10
10
  * Cleans a URL by removing the query string and fragment (hash portion).
11
- * @param {string} url - The original URL to be cleaned.
11
+ * @param {string} [url] - The original URL to be cleaned.
12
12
  * @param {boolean} [keepHash=false] - Whether to preserve the hash portion of the URL.
13
13
  * @returns {string} The cleaned URL.
14
14
  */
15
15
  export function cleanURL(url, keepHash) {
16
+ if (!url) return url;
16
17
  return url.replace(keepHash ? patternWithHash : patternWithoutHash, '$1$2');
17
18
  }
@@ -13,7 +13,8 @@ export class InitialPageLoadInteraction extends Interaction {
13
13
  super(agentRef, IPL_TRIGGER_NAME, 0, null);
14
14
  this.queueTime = agentRef.info.queueTime;
15
15
  this.appTime = agentRef.info.applicationTime;
16
- this.oldURL = document.referrer;
16
+ /** @type {string|undefined} we assign as undefined if no referrer value is available so that URL grouping is not applied to an empty string at ingest */
17
+ this.oldURL = document.referrer || undefined;
17
18
  }
18
19
  get firstPaint() {
19
20
  return firstPaint.current.value;
@@ -27,7 +27,7 @@ export function Interaction(eventName, timestamp, url, routeName, onFinished, ag
27
27
  attrs.initialPageURL = initialLocation;
28
28
  attrs.oldRoute = routeName;
29
29
  attrs.newURL = url;
30
- attrs.oldURL = eventName === 'initialPageLoad' ? document.referrer : url;
30
+ attrs.oldURL = eventName === 'initialPageLoad' ? document.referrer || undefined : url; // document referrer can return '' and flipper url grouping gets weird with empty strings. Pass undefined to skip flipper.
31
31
  attrs.custom = {};
32
32
  attrs.store = {};
33
33
  }
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Cleans a URL by removing the query string and fragment (hash portion).
3
- * @param {string} url - The original URL to be cleaned.
3
+ * @param {string} [url] - The original URL to be cleaned.
4
4
  * @param {boolean} [keepHash=false] - Whether to preserve the hash portion of the URL.
5
5
  * @returns {string} The cleaned URL.
6
6
  */
7
- export function cleanURL(url: string, keepHash?: boolean): string;
7
+ export function cleanURL(url?: string, keepHash?: boolean): string;
8
8
  //# sourceMappingURL=clean-url.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clean-url.d.ts","sourceRoot":"","sources":["../../../../src/common/url/clean-url.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,8BAJW,MAAM,aACN,OAAO,GACL,MAAM,CAIlB"}
1
+ {"version":3,"file":"clean-url.d.ts","sourceRoot":"","sources":["../../../../src/common/url/clean-url.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,+BAJW,MAAM,aACN,OAAO,GACL,MAAM,CAKlB"}
@@ -1,6 +1,5 @@
1
1
  export class InitialPageLoadInteraction extends Interaction {
2
2
  constructor(agentRef: any);
3
- oldURL: string;
4
3
  get firstPaint(): any;
5
4
  get firstContentfulPaint(): any;
6
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"initial-page-load-interaction.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/aggregate/initial-page-load-interaction.js"],"names":[],"mappings":"AAWA;IACE,2BAKC;IADC,eAA+B;IAGjC,sBAAqD;IACrD,gCAAyE;IAEzE;;;OAGG;IACH,oCA6BC;CACF;4BAnD2B,eAAe"}
1
+ {"version":3,"file":"initial-page-load-interaction.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/aggregate/initial-page-load-interaction.js"],"names":[],"mappings":"AAWA;IACE,2BAMC;IAED,sBAAqD;IACrD,gCAAyE;IAEzE;;;OAGG;IACH,oCA6BC;CACF;4BApD2B,eAAe"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.293.0-rc.1",
3
+ "version": "1.293.0-rc.3",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -8,10 +8,11 @@ var patternWithoutHash = /([^?#]*)().*/
8
8
 
9
9
  /**
10
10
  * Cleans a URL by removing the query string and fragment (hash portion).
11
- * @param {string} url - The original URL to be cleaned.
11
+ * @param {string} [url] - The original URL to be cleaned.
12
12
  * @param {boolean} [keepHash=false] - Whether to preserve the hash portion of the URL.
13
13
  * @returns {string} The cleaned URL.
14
14
  */
15
15
  export function cleanURL (url, keepHash) {
16
+ if (!url) return url
16
17
  return url.replace(keepHash ? patternWithHash : patternWithoutHash, '$1$2')
17
18
  }
@@ -14,7 +14,8 @@ export class InitialPageLoadInteraction extends Interaction {
14
14
  super(agentRef, IPL_TRIGGER_NAME, 0, null)
15
15
  this.queueTime = agentRef.info.queueTime
16
16
  this.appTime = agentRef.info.applicationTime
17
- this.oldURL = document.referrer
17
+ /** @type {string|undefined} we assign as undefined if no referrer value is available so that URL grouping is not applied to an empty string at ingest */
18
+ this.oldURL = document.referrer || undefined
18
19
  }
19
20
 
20
21
  get firstPaint () { return firstPaint.current.value }
@@ -33,7 +33,7 @@ export function Interaction (eventName, timestamp, url, routeName, onFinished, a
33
33
  attrs.initialPageURL = initialLocation
34
34
  attrs.oldRoute = routeName
35
35
  attrs.newURL = url
36
- attrs.oldURL = eventName === 'initialPageLoad' ? document.referrer : url
36
+ attrs.oldURL = eventName === 'initialPageLoad' ? document.referrer || undefined : url // document referrer can return '' and flipper url grouping gets weird with empty strings. Pass undefined to skip flipper.
37
37
  attrs.custom = {}
38
38
  attrs.store = {}
39
39
  }