From 0e2b2100003beb7eae71e9142e3448b61f1d002f Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 8 Nov 2024 12:55:10 +0000 Subject: [PATCH] fix(lib): update scripts/aem.js to aem.js@2.7.3 Test URL: https://update-lib-aem-patch-2-7-3--aem-boilerplate--adobe.hlx.live/ Release Notes: https://github.com/adobe/aem-lib/releases/tag/v2.7.3 --- scripts/aem.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/aem.js b/scripts/aem.js index 40662e6148..2ace3102c6 100644 --- a/scripts/aem.js +++ b/scripts/aem.js @@ -100,10 +100,14 @@ function sampleRUM(checkpoint, data) { sampleRUM.enhance = () => { // only enhance once if (document.querySelector('script[src*="rum-enhancer"]')) return; - + const { enhancerVersion, enhancerHash } = sampleRUM.enhancerContext || {}; const script = document.createElement('script'); + if (enhancerHash) { + script.integrity = enhancerHash; + script.setAttribute('crossorigin', 'anonymous'); + } script.src = new URL( - '.rum/@adobe/helix-rum-enhancer@^2/src/index.js', + `.rum/@adobe/helix-rum-enhancer@${enhancerVersion || '^2'}/src/index.js`, sampleRUM.baseURL, ).href; document.head.appendChild(script);