Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function registerCss(module: { default?: string | CSSStyleSheet } | undef
fontFaceStyleSheet.insertRule(fontFace)
}
mainWindow.document.adoptedStyleSheets = [
...mainWindow.document.adoptedStyleSheets,
...(mainWindow.document.adoptedStyleSheets ?? []),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is adoptedStyleSheets undefined? because I agree it will prevent the error from being triggered, but it most probably means that adoptedStyleSheets is not supported at all, so all the styleSheets won't work anyway and the page will still be unusable 🤔

adoptedStyleSheets is supported in all major browsers since 2024 for the latest, so I'm wondering 🤔

fontFaceStyleSheet
]
}
Expand All @@ -55,5 +55,5 @@ export function injectCss(target: HTMLElement) {
)
}

root.adoptedStyleSheets = [...root.adoptedStyleSheets, ...sheets]
root.adoptedStyleSheets = [...(root.adoptedStyleSheets ?? []), ...sheets]
}
Loading