Skip to content

Commit

Permalink
Add structuredClone polyfill for ACDL
Browse files Browse the repository at this point in the history
  • Loading branch information
herzog31 committed Dec 18, 2024
1 parent 19d1799 commit 536224f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module.exports = {
extends: 'airbnb-base',
env: {
browser: true,
es2020: true,
},
parser: '@babel/eslint-parser',
parserOptions: {
Expand Down
5 changes: 5 additions & 0 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ async function loadLazy(doc) {
const element = hash ? doc.getElementById(hash.substring(1)) : false;
if (hash && element) element.scrollIntoView();

if (!('structuredClone' in window)) {
// eslint-disable-next-line import/no-unresolved
window.structuredClone = (await import('https://cdn.jsdelivr.net/npm/@ungap/[email protected]/+esm')).default;
}

await Promise.all([
loadHeader(doc.querySelector('header')),
loadFooter(doc.querySelector('footer')),
Expand Down

0 comments on commit 536224f

Please sign in to comment.