removed console warnings
This commit is contained in:
parent
8105cfa136
commit
8338657bad
|
|
@ -2358,6 +2358,17 @@ function noteApp() {
|
||||||
|
|
||||||
for (const sheet of styleSheets) {
|
for (const sheet of styleSheets) {
|
||||||
try {
|
try {
|
||||||
|
// Skip external stylesheets (CDN resources) to avoid CORS errors
|
||||||
|
// We link them directly in the exported HTML anyway
|
||||||
|
if (sheet.href && (sheet.href.startsWith('http://') || sheet.href.startsWith('https://'))) {
|
||||||
|
const currentOrigin = window.location.origin;
|
||||||
|
const sheetURL = new URL(sheet.href);
|
||||||
|
if (sheetURL.origin !== currentOrigin) {
|
||||||
|
// Skip cross-origin stylesheets (they're linked directly in export)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const rules = Array.from(sheet.cssRules || []);
|
const rules = Array.from(sheet.cssRules || []);
|
||||||
for (const rule of rules) {
|
for (const rule of rules) {
|
||||||
const cssText = rule.cssText;
|
const cssText = rule.cssText;
|
||||||
|
|
@ -2370,8 +2381,9 @@ function noteApp() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Skip stylesheets that can't be accessed (CORS)
|
// Gracefully skip stylesheets that can't be accessed
|
||||||
console.warn('Could not access stylesheet:', sheet.href, e);
|
// (This should rarely happen now that we skip external stylesheets)
|
||||||
|
console.debug('Skipping stylesheet:', sheet.href);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue