@adobe/helix-rum-enhancer 1.14.0 → 1.15.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 +14 -0
- package/package.json +2 -2
- package/src/index.js +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.15.1](https://github.com/adobe/helix-rum-enhancer/compare/v1.15.0...v1.15.1) (2024-04-18)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* make targetselector null safe ([#157](https://github.com/adobe/helix-rum-enhancer/issues/157)) ([6f8e117](https://github.com/adobe/helix-rum-enhancer/commit/6f8e11753358e835688d3dfd2d4a0d7f420848a5))
|
|
7
|
+
|
|
8
|
+
# [1.15.0](https://github.com/adobe/helix-rum-enhancer/compare/v1.14.0...v1.15.0) (2024-04-18)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* add logic to capture target from wrapping anchor tag ([9f40d95](https://github.com/adobe/helix-rum-enhancer/commit/9f40d951021aa452b0cb8020c8ef1c2f5e68d069))
|
|
14
|
+
|
|
1
15
|
# [1.14.0](https://github.com/adobe/helix-rum-enhancer/compare/v1.13.2...v1.14.0) (2024-04-16)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-rum-enhancer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.1",
|
|
4
4
|
"description": "Helix RUM Enhancer",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"lint-staged": "15.2.2",
|
|
45
45
|
"mocha": "10.4.0",
|
|
46
46
|
"mocha-multi-reporters": "1.5.1",
|
|
47
|
-
"semantic-release": "
|
|
47
|
+
"semantic-release": "23.0.8"
|
|
48
48
|
},
|
|
49
49
|
"lint-staged": {
|
|
50
50
|
"*.js": "eslint",
|
package/src/index.js
CHANGED
|
@@ -67,8 +67,16 @@ new PerformanceObserver((list) => list
|
|
|
67
67
|
.observe({ type: 'navigation', buffered: true });
|
|
68
68
|
|
|
69
69
|
sampleRUM.targetselector = (element) => {
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
if (!element) return undefined;
|
|
71
|
+
const getTargetValue = (el) => el.getAttribute('data-rum-target') || el.getAttribute('href')
|
|
72
|
+
|| el.currentSrc || el.getAttribute('src')
|
|
73
|
+
|| el.dataset.action || el.action;
|
|
74
|
+
|
|
75
|
+
let value = getTargetValue(element);
|
|
76
|
+
if (!value && element.tagName !== 'A' && element.closest('a')) {
|
|
77
|
+
value = getTargetValue(element.closest('a'));
|
|
78
|
+
}
|
|
79
|
+
|
|
72
80
|
if (value && !value.startsWith('https://')) {
|
|
73
81
|
// resolve relative links
|
|
74
82
|
value = new URL(value, window.location).href;
|