Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

clipper: ignore print stylesheets when adding to head Signed-off-by: 01zulfi <[email protected]>

01zulfi200c842671fd
diff --git a/packages/clipper/src/styles.ts b/packages/clipper/src/styles.ts
index 20ae8bb58..fb351fa8b 100644
--- a/packages/clipper/src/styles.ts
+++ b/packages/clipper/src/styles.ts
@@ -74,6 +74,10 @@ async function skipStyleSheet(sheet: CSSStyleSheet, options?: FetchOptions) {
return true;
}
+ return isStylesheetForPrint(sheet);
+}
+
+function isStylesheetForPrint(sheet: CSSStyleSheet) {
return sheet.media.mediaText
.split(",")
.map((t) => t.trim())
@@ -85,6 +89,7 @@ export async function addStylesToHead(
options?: FetchOptions
) {
for (const sheet of document.styleSheets) {
+ if (isStylesheetForPrint(sheet)) continue;
const node = sheet.ownerNode;
const href =
sheet.href && node instanceof HTMLLinkElement