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.mjs CHANGED
@@ -417,10 +417,33 @@ function ScreenshotButton({
417
417
  if (isWidget) return true;
418
418
  const tagName = element.tagName;
419
419
  if (tagName === "IMG" || tagName === "CANVAS" || tagName === "VIDEO" || tagName === "SVG") {
420
- const rect = element.getBoundingClientRect();
421
- if (rect.width < 1 || rect.height < 1) {
422
- console.warn("FeedbackWidget: Ignoring 0-sized media element:", tagName, element);
423
- return true;
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);
424
447
  }
425
448
  }
426
449
  return false;