diff --git a/acrobat/scripts/scripts.js b/acrobat/scripts/scripts.js index 6f00da03..3e5ccbab 100644 --- a/acrobat/scripts/scripts.js +++ b/acrobat/scripts/scripts.js @@ -463,19 +463,6 @@ const { ietf } = getLocale(locales); paths.forEach((css) => loadStyle(css)); } - // Configurable preloads - const preloads = document.querySelector('meta[name="preloads"]')?.content; - if (preloads) { - preloads.split(',').forEach((x) => { - const link = x.trim().replace('$MILOLIBS', miloLibs); - if (link.endsWith('.js')) { - loadLink(link, { as: 'script', rel: 'preload', crossorigin: 'anonymous' }); - } else if (link.endsWith('.css')) { - loadStyle(link); - } - }); - } - // Import base milo features and run them const { loadArea, setConfig, loadLana, getMetadata, loadIms } = await import(`${miloLibs}/utils/utils.js`); addLocale(ietf); diff --git a/head.html b/head.html index 7010b69a..ec13c6e5 100644 --- a/head.html +++ b/head.html @@ -1,6 +1,66 @@ - + + \ No newline at end of file diff --git a/test/scripts/scripts-preloads.test.js b/test/scripts/scripts-preloads.test.js deleted file mode 100644 index 4aa79465..00000000 --- a/test/scripts/scripts-preloads.test.js +++ /dev/null @@ -1,20 +0,0 @@ -import { expect } from '@esm-bundle/chai'; -import { waitForElement } from '../helpers/waitfor.js'; - -describe('Test scripts.js configurable preloads', () => { - it('has preload metadata', async () => { - document.head.innerHTML = ''; - document.body.innerHTML = '
'; - await import('../../acrobat/scripts/scripts.js'); - const js = document.querySelector('link[rel="preload"][href="https://main--milo--adobecom.hlx.live/libs/blocks/marquee/marquee.js"]'); - const css = document.querySelector('link[rel="stylesheet"][href="https://main--milo--adobecom.hlx.live/libs/blocks/marquee/marquee.css"]'); - const other = document.querySelector('link[rel="preload"][href="https://www.example.com/abc.js"]'); - const acrobatcss = document.querySelector('link[rel="stylesheet"][href="/acrobat/styles/styles.css"]'); - const milocss = document.querySelector('link[rel="stylesheet"][href="https://main--milo--adobecom.hlx.live/libs/styles/styles.css"]'); - expect(js).not.to.be.null; - expect(css).not.to.be.null; - expect(other).not.to.be.null; - expect(acrobatcss).not.to.be.null; - expect(milocss).not.to.be.null; - }); -});