From a671576203820d353c642409d9f6a124f1ac25a0 Mon Sep 17 00:00:00 2001 From: Fiona Date: Tue, 1 Sep 2026 00:09:51 -0700 Subject: [PATCH] fix(rum-legacy): reload the verification page by its own url MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The page exit check navigated to a literal `index.html`, which only works while the file keeps that name. It does not survive being copied into an offline package and served from another host, where it is usually renamed to avoid colliding with that site's own index: the button then navigates to a url that does not exist. The failure is quiet. Nothing is logged, the page simply stops loading — on the browsers this page exists to test, where there is often no usable devtools to explain it. Reload the url the page was actually opened at instead. Dropping the query rather than appending keeps a second press idempotent, and a directory-style url stays as it is rather than being rewritten to /index.html, which the bundled verification server serves identically. --- packages/rum-legacy/verification/index.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/rum-legacy/verification/index.html b/packages/rum-legacy/verification/index.html index 00297a20b4..2bf32b7f4a 100644 --- a/packages/rum-legacy/verification/index.html +++ b/packages/rum-legacy/verification/index.html @@ -511,11 +511,19 @@

RUM legacy build verification

document.getElementById('exit').onclick = function () { // Remember how many requests the intake had, reload to fire beforeunload, and let the // reloaded page prove the exit added one more, sent synchronously or lost. + // + // Reload whatever url this page was actually opened at, rather than a literal index.html: + // this file is copied into offline packages for customers who serve it from their own host, + // where it is often renamed to avoid colliding with their site's own index. A hardcoded + // name sends that copy to a url that does not exist, and the only symptom is a page that + // stops loading - no error, on browsers that frequently have no usable devtools. Dropping + // the query rather than appending keeps a second press idempotent, and preserves a + // directory-style url instead of rewriting it to /index.html. readReceived(function (arrived) { try { window.sessionStorage.setItem(PRE_EXIT_KEY, String(arrived.length)) } catch (error) {} - window.location.href = 'index.html?after-exit=1' + window.location.href = window.location.href.split('?')[0] + '?after-exit=1' }) }