@adobe/helix-rum-enhancer 2.2.0 → 2.3.1

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
@@ -1,3 +1,17 @@
1
+ ## [2.3.1](https://github.com/adobe/helix-rum-enhancer/compare/v2.3.0...v2.3.1) (2024-03-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add json type header to beacon ([a1e0807](https://github.com/adobe/helix-rum-enhancer/commit/a1e0807f735a7c8097c588f401efdb9aac08dfc7))
7
+
8
+ # [2.3.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.2.0...v2.3.0) (2024-03-06)
9
+
10
+
11
+ ### Features
12
+
13
+ * **minirum:** allow different base urls for collection and extra scripts ([c32c7b9](https://github.com/adobe/helix-rum-enhancer/commit/c32c7b9c3f7838ced71e372889fb618b3befe098))
14
+
1
15
  # [2.2.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.1.1...v2.2.0) (2024-03-04)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-rum-enhancer",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
4
4
  "description": "Helix RUM Enhancer",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/index.js CHANGED
@@ -81,8 +81,9 @@ function trackCheckpoint(checkpoint, data, t) {
81
81
  const sendPing = (pdata = data) => {
82
82
  // eslint-disable-next-line object-curly-newline, max-len
83
83
  const body = JSON.stringify({ weight, id, sanitizeURL: urlSanitizers[window.hlx.RUM_MASK_URL || 'path'], checkpoint, t, ...data }, KNOWN_PROPERTIES);
84
- const url = new URL(`.rum/${weight}`, sampleRUM.baseURL).href;
85
- navigator.sendBeacon(url, body);
84
+ const url = new URL(`.rum/${weight}`, sampleRUM.collectBaseURL || sampleRUM.baseURL).href;
85
+ const headers = { type: 'application/json' };
86
+ navigator.sendBeacon(url, new Blob([body], headers));
86
87
  // eslint-disable-next-line no-console
87
88
  console.debug(`ping:${checkpoint}`, pdata);
88
89
  };