feedback-vos 1.0.49 → 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 +27 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -423,10 +423,33 @@ function ScreenshotButton({
|
|
|
423
423
|
if (isWidget) return true;
|
|
424
424
|
const tagName = element.tagName;
|
|
425
425
|
if (tagName === "IMG" || tagName === "CANVAS" || tagName === "VIDEO" || tagName === "SVG") {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
426
|
+
try {
|
|
427
|
+
const rect = element.getBoundingClientRect();
|
|
428
|
+
if (rect.width < 1 || rect.height < 1) {
|
|
429
|
+
return true;
|
|
430
|
+
}
|
|
431
|
+
if (tagName === "CANVAS") {
|
|
432
|
+
const canvas2 = element;
|
|
433
|
+
if (canvas2.width === 0 || canvas2.height === 0) {
|
|
434
|
+
console.warn("FeedbackWidget: Ignored 0-intrinsic canvas:", element);
|
|
435
|
+
return true;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
if (tagName === "IMG") {
|
|
439
|
+
const img = element;
|
|
440
|
+
if (img.getAttribute("src") && img.naturalWidth === 0) {
|
|
441
|
+
return true;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
if (tagName === "VIDEO") {
|
|
445
|
+
const video = element;
|
|
446
|
+
if (video.readyState >= 1 && (video.videoWidth === 0 || video.videoHeight === 0)) {
|
|
447
|
+
console.warn("FeedbackWidget: Ignored 0-intrinsic video:", element);
|
|
448
|
+
return true;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
} catch (e) {
|
|
452
|
+
console.warn("FeedbackWidget: Error checking element dimensions, ignoring safety check for:", element, e);
|
|
430
453
|
}
|
|
431
454
|
}
|
|
432
455
|
return false;
|