Skip to content

Commit

Permalink
feat(lib): update scripts/aem.js to [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
semantic-release-bot committed Oct 17, 2024
1 parent 7312419 commit 0b10102
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scripts/aem.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ function sampleRUM(checkpoint, data) {
t: time,
...pingData,
});
const { href: url, origin } = new URL(`.rum/${weight}`, sampleRUM.collectBaseURL);
const urlParams = window.RUM_PARAMS
? `?${new URLSearchParams(window.RUM_PARAMS).toString()}`
: '';
const { href: url, origin } = new URL(
`.rum/${weight}${urlParams}`,
sampleRUM.collectBaseURL,
);
const body = origin === window.location.origin
? new Blob([rumData], { type: 'application/json' })
: rumData;
Expand Down Expand Up @@ -108,7 +114,7 @@ function sampleRUM(checkpoint, data) {
}
document.dispatchEvent(new CustomEvent('rum', { detail: { checkpoint, data } }));
} catch (error) {
// something went wrong
// something went awry
}
}

Expand Down Expand Up @@ -684,6 +690,9 @@ async function loadSections(element) {
for (let i = 0; i < sections.length; i += 1) {
// eslint-disable-next-line no-await-in-loop
await loadSection(sections[i]);
if (i === 0 && sampleRUM.enhance) {
sampleRUM.enhance();
}
}
}

Expand Down

0 comments on commit 0b10102

Please sign in to comment.