@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.
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/url/clean-url.js +2 -1
- package/dist/cjs/features/soft_navigations/aggregate/initial-page-load-interaction.js +2 -1
- package/dist/cjs/features/spa/aggregate/interaction.js +1 -1
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/url/clean-url.js +2 -1
- package/dist/esm/features/soft_navigations/aggregate/initial-page-load-interaction.js +2 -1
- package/dist/esm/features/spa/aggregate/interaction.js +1 -1
- package/dist/types/common/url/clean-url.d.ts +2 -2
- package/dist/types/common/url/clean-url.d.ts.map +1 -1
- package/dist/types/features/soft_navigations/aggregate/initial-page-load-interaction.d.ts +0 -1
- package/dist/types/features/soft_navigations/aggregate/initial-page-load-interaction.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common/url/clean-url.js +2 -1
- package/src/features/soft_navigations/aggregate/initial-page-load-interaction.js +2 -1
- package/src/features/spa/aggregate/interaction.js +1 -1
|
@@ -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.
|
|
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.
|
|
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
|
-
|
|
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
|
}
|
|
@@ -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
|
-
|
|
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
|
|
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,
|
|
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"}
|
package/dist/types/features/soft_navigations/aggregate/initial-page-load-interaction.d.ts.map
CHANGED
|
@@ -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,
|
|
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
|
@@ -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
|
-
|
|
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
|
}
|