@adobe/helix-rum-enhancer
Advanced tools
Comparing version 1.14.0 to 1.15.0
@@ -0,1 +1,8 @@ | ||
# [1.15.0](https://github.com/adobe/helix-rum-enhancer/compare/v1.14.0...v1.15.0) (2024-04-18) | ||
### Features | ||
* add logic to capture target from wrapping anchor tag ([9f40d95](https://github.com/adobe/helix-rum-enhancer/commit/9f40d951021aa452b0cb8020c8ef1c2f5e68d069)) | ||
# [1.14.0](https://github.com/adobe/helix-rum-enhancer/compare/v1.13.2...v1.14.0) (2024-04-16) | ||
@@ -2,0 +9,0 @@ |
{ | ||
"name": "@adobe/helix-rum-enhancer", | ||
"version": "1.14.0", | ||
"version": "1.15.0", | ||
"description": "Helix RUM Enhancer", | ||
@@ -47,3 +47,3 @@ "main": "src/index.js", | ||
"mocha-multi-reporters": "1.5.1", | ||
"semantic-release": "22.0.12" | ||
"semantic-release": "23.0.8" | ||
}, | ||
@@ -50,0 +50,0 @@ "lint-staged": { |
@@ -70,4 +70,11 @@ /* | ||
sampleRUM.targetselector = (element) => { | ||
let value = element.getAttribute('data-rum-target') || element.getAttribute('href') || element.currentSrc || element.getAttribute('src') | ||
|| element.dataset.action || element.action; | ||
const getTargetValue = (el) => el.getAttribute('data-rum-target') || el.getAttribute('href') | ||
|| el.currentSrc || el.getAttribute('src') | ||
|| el.dataset.action || el.action; | ||
let value = getTargetValue(element); | ||
if (!value && element.tagName !== 'A' && element.closest('a')) { | ||
value = getTargetValue(element.closest('a')); | ||
} | ||
if (value && !value.startsWith('https://')) { | ||
@@ -74,0 +81,0 @@ // resolve relative links |
42158
238