Skip to content

Commit

Permalink
fix(components): ignore external domain stylesheets in NewWindow styl…
Browse files Browse the repository at this point in the history
…es copying
  • Loading branch information
ivangabriele committed May 28, 2024
1 parent 698ddb4 commit fb02756
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/NewWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,12 @@ function onCopyStyles(source: Document, target: Document | undefined): void {
try {
rules = styleSheet.cssRules
} catch (err) {
console.error(err)
// An error here most likely happens when trying to access stylesheets from other domains,
// which is a CORS violation and should be ignored.
// eslint-disable-next-line no-console
console.debug(err)

return
}
if (rules) {
// IE11 is very slow for appendChild, so use plain string here
Expand Down

0 comments on commit fb02756

Please sign in to comment.