Skip to content

Commit 997d7c2

Browse files
committed
feat: watermark image element
1 parent 565a643 commit 997d7c2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/water-mark/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"zh": "🔥🔥🔥移除页面水印🔥🔥🔥"
66
},
77
"namespace": "https://github.com/WindrunnerMax/TKScript",
8-
"version": "1.0.6",
8+
"version": "1.0.7",
99
"description": {
1010
"default": "移除常见网页的水印",
1111
"en": "Remove watermarks from common web pages",

packages/water-mark/src/utils/dom.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ export const inspectWaterMarkDOM = (node: Node) => {
1010
if (!node.hasAttribute("style") || node.style.pointerEvents !== "none") {
1111
return false;
1212
}
13+
if (node instanceof HTMLImageElement && node.src && node.src.startsWith("data:")) {
14+
!node.classList.contains(FALLBACK_CLASS) && node.classList.add(FALLBACK_CLASS);
15+
return true;
16+
}
1317
if (node.style.background.startsWith("url") || node.style.backgroundImage.startsWith("url")) {
1418
!node.classList.contains(FALLBACK_CLASS) && node.classList.add(FALLBACK_CLASS);
1519
return true;

0 commit comments

Comments
 (0)