Skip to content

Commit

Permalink
Revert "fix: catch access stylesheet error"
Browse files Browse the repository at this point in the history
This reverts commit 16a6231.
  • Loading branch information
DIYgod committed Sep 22, 2024
1 parent 61ca6b4 commit e089b9b
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions apps/renderer/src/components/common/ShadowDOM.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,25 +153,21 @@ function getLinkedStaticStyleSheets() {
if (!sheet) continue
if (!sheet.href) continue
const hasCache = cacheCssTextMap[sheet.href]
try {
if (!hasCache) {
if (!sheet.href) continue
const rules = sheet.cssRules || sheet.rules
let cssText = ""
for (const rule of rules) {
cssText += rule.cssText
}

cacheCssTextMap[sheet.href] = cssText
cssArray.push({
cssText: cacheCssTextMap[sheet.href],
ref: $link,
})
if (!hasCache) {
if (!sheet.href) continue
const rules = sheet.cssRules || sheet.rules
let cssText = ""
for (const rule of rules) {
cssText += rule.cssText
}
} catch (e) {
console.info("Parse css error", sheet.href)
console.error(e)

cacheCssTextMap[sheet.href] = cssText
}

cssArray.push({
cssText: cacheCssTextMap[sheet.href],
ref: $link,
})
}

return cssArray
Expand Down

0 comments on commit e089b9b

Please sign in to comment.