From 363db1410562c327f9c48f37c437965d91b87edf Mon Sep 17 00:00:00 2001 From: Fiona Date: Tue, 1 Sep 2026 00:18:46 -0700 Subject: [PATCH] fix(rum-legacy): tell the verification page's reader what went wrong Two failures on this page do not name their own cause, and both read as a broken SDK to whoever is looking. Opening the page straight from the repository fails the first check with "window.FC_RUM is undefined" and stops. The bundle is not in the verification directory and the repository does not carry it; the page is meant to be served through scripts/verification-server.js, which puts the built file next to it. The message now says that. Serving it over file:// fails the session cookie check, because the browser refuses to write a cookie for that protocol, and leaves the same-origin intake with no origin to answer. The environment table now reports location.protocol, and calls out file: where it appears, so the reason is visible above the failing rows rather than inferred. Both matter most on the browsers this page exists to test, where there is frequently no console to investigate with. --- packages/rum-legacy/verification/index.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/rum-legacy/verification/index.html b/packages/rum-legacy/verification/index.html index 2bf32b7f4a..1e0bb47740 100644 --- a/packages/rum-legacy/verification/index.html +++ b/packages/rum-legacy/verification/index.html @@ -172,7 +172,14 @@

RUM legacy build verification

function showEnvironment() { var mode = typeof document.documentMode === 'undefined' ? '(none - documentMode needs IE8+, or not Trident at all)' : document.documentMode + /* The protocol decides two results on this page and neither failure names it: over file:// + the browser refuses to write the session cookie, and there is no origin to send a + same-origin request to. Both then read as a broken SDK. */ + var protocol = window.location.protocol + var protocolNote = + protocol === 'file:' ? 'file: (serve this page over http(s) - see the notes below)' : protocol var pairs = [ + ['location.protocol', protocolNote], ['document.documentMode', String(mode)], ['navigator.userAgent', navigator.userAgent], [ @@ -290,7 +297,12 @@

RUM legacy build verification

loadBundle(function (loaded) { if (!loaded || !window.FC_RUM) { record('The bundle parses and loads', 'fail', 'window.FC_RUM is ' + typeof window.FC_RUM) - note('Stopped: nothing else can be checked while the script does not load.') + note( + 'Stopped: fc-rum-legacy.js did not load. It has to be served from the same ' + + 'directory as this page. This repository does not carry the built bundle - run ' + + 'the package build, then open this page through scripts/verification-server.js, ' + + 'which serves the two together.' + ) return } record('The bundle parses and loads', 'pass', 'FC_RUM.version = ' + window.FC_RUM.version)