From a9ba59dccc4712571530fd785bb9aa6cc277bea8 Mon Sep 17 00:00:00 2001 From: Lars Trieloff Date: Mon, 4 Mar 2024 12:20:41 +0100 Subject: [PATCH] feat(resources): add missingresource checkpoint behind feature toggle --- src/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/index.js b/src/index.js index 864a1aa..845da27 100644 --- a/src/index.js +++ b/src/index.js @@ -171,6 +171,15 @@ function addLoadResourceTracking() { .forEach((entry) => { sampleRUM('loadresource', { source: entry.name, target: Math.round(entry.duration) }); }); + + if (window.origin === 'business.adobe.com') { + // feature flagged for now + list.getEntries() + .filter((entry) => entry.responseStatus === 404) + .forEach((entry) => { + sampleRUM('missingresource', { source: entry.name, target: entry.hostname }); + }); + } }); observer.observe({ type: 'resource', buffered: true }); }