feedback-vos 1.0.47 → 1.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +30 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -415,9 +415,36 @@ function ScreenshotButton({
|
|
|
415
415
|
ignoreElements: (element) => {
|
|
416
416
|
const isWidget = element.hasAttribute("data-feedback-widget") || element.closest("[data-feedback-widget]") !== null;
|
|
417
417
|
if (isWidget) return true;
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
418
|
+
const tagName = element.tagName;
|
|
419
|
+
if (tagName === "IMG" || tagName === "CANVAS" || tagName === "VIDEO" || tagName === "SVG") {
|
|
420
|
+
try {
|
|
421
|
+
const rect = element.getBoundingClientRect();
|
|
422
|
+
if (rect.width < 1 || rect.height < 1) {
|
|
423
|
+
return true;
|
|
424
|
+
}
|
|
425
|
+
if (tagName === "CANVAS") {
|
|
426
|
+
const canvas2 = element;
|
|
427
|
+
if (canvas2.width === 0 || canvas2.height === 0) {
|
|
428
|
+
console.warn("FeedbackWidget: Ignored 0-intrinsic canvas:", element);
|
|
429
|
+
return true;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
if (tagName === "IMG") {
|
|
433
|
+
const img = element;
|
|
434
|
+
if (img.getAttribute("src") && img.naturalWidth === 0) {
|
|
435
|
+
return true;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
if (tagName === "VIDEO") {
|
|
439
|
+
const video = element;
|
|
440
|
+
if (video.readyState >= 1 && (video.videoWidth === 0 || video.videoHeight === 0)) {
|
|
441
|
+
console.warn("FeedbackWidget: Ignored 0-intrinsic video:", element);
|
|
442
|
+
return true;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
} catch (e) {
|
|
446
|
+
console.warn("FeedbackWidget: Error checking element dimensions, ignoring safety check for:", element, e);
|
|
447
|
+
}
|
|
421
448
|
}
|
|
422
449
|
return false;
|
|
423
450
|
}
|