diff --git a/src/mashlib/index.js b/src/mashlib/index.js index c308066..33016e7 100644 --- a/src/mashlib/index.js +++ b/src/mashlib/index.js @@ -266,29 +266,230 @@ export function generateDatabrowserHtml(resourceUrl, cdnVersion = null, opts = { const island = dataIsland(resourceUrl, opts.embedJsonLd); const reader = opts.roundTripOptimization === false ? '' : roundTripOptimizationScript(); if (cdnVersion) { - // CDN mode - use script.onload to ensure mashlib is fully loaded before init - // This avoids race conditions with defer + DOMContentLoaded + // CDN mode: load the matching mashlib databrowser shell template from CDN, + // then load CSS/JS from the same version while staying on this origin. const cdnBase = `https://unpkg.com/mashlib@${cdnVersion}/dist`; - return `
Loading Mashlib…
`; } // Local mode - use defer (reliable when served locally) - return `