@uxbertlabs/reportly 1.0.7 → 1.0.8

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.
@@ -9447,18 +9447,20 @@ class Screenshot {
9447
9447
  constructor() {
9448
9448
  this.currentScreenshot = null;
9449
9449
  }
9450
- async capture(mode = 'fullpage') {
9450
+ async capture(mode = "fullpage") {
9451
9451
  try {
9452
9452
  // Hide UXbert UI elements before capturing
9453
9453
  this.hideUXbertElements();
9454
9454
  const originalScrollY = window.scrollY;
9455
9455
  let canvas;
9456
- if (mode === 'viewport') {
9456
+ if (mode === "viewport") {
9457
9457
  // Capture only the current viewport
9458
9458
  canvas = await html2canvas(document.body, {
9459
+ // foreignObjectRendering: true,
9460
+ imageTimeout: 40000,
9459
9461
  useCORS: true,
9460
9462
  allowTaint: false,
9461
- logging: false,
9463
+ logging: true,
9462
9464
  width: window.innerWidth,
9463
9465
  height: window.innerHeight,
9464
9466
  windowWidth: window.innerWidth,
@@ -9467,12 +9469,12 @@ class Screenshot {
9467
9469
  y: window.scrollY,
9468
9470
  ignoreElements: (element) => {
9469
9471
  // Skip cross-origin images that might cause issues
9470
- if (element.tagName === 'IMG') {
9472
+ if (element.tagName === "IMG") {
9471
9473
  const img = element;
9472
9474
  try {
9473
9475
  // Test if image is accessible
9474
- const canvas = document.createElement('canvas');
9475
- const ctx = canvas.getContext('2d');
9476
+ const canvas = document.createElement("canvas");
9477
+ const ctx = canvas.getContext("2d");
9476
9478
  canvas.width = 1;
9477
9479
  canvas.height = 1;
9478
9480
  ctx?.drawImage(img, 0, 0, 1, 1);
@@ -9481,7 +9483,7 @@ class Screenshot {
9481
9483
  }
9482
9484
  catch (e) {
9483
9485
  // Image is tainted, skip it
9484
- console.warn('Skipping cross-origin image:', img.src);
9486
+ console.warn("Skipping cross-origin image:", img.src);
9485
9487
  return true;
9486
9488
  }
9487
9489
  }
@@ -9504,12 +9506,12 @@ class Screenshot {
9504
9506
  height: fullPageHeight,
9505
9507
  ignoreElements: (element) => {
9506
9508
  // Skip cross-origin images that might cause issues
9507
- if (element.tagName === 'IMG') {
9509
+ if (element.tagName === "IMG") {
9508
9510
  const img = element;
9509
9511
  try {
9510
9512
  // Test if image is accessible
9511
- const canvas = document.createElement('canvas');
9512
- const ctx = canvas.getContext('2d');
9513
+ const canvas = document.createElement("canvas");
9514
+ const ctx = canvas.getContext("2d");
9513
9515
  canvas.width = 1;
9514
9516
  canvas.height = 1;
9515
9517
  ctx?.drawImage(img, 0, 0, 1, 1);
@@ -9518,7 +9520,7 @@ class Screenshot {
9518
9520
  }
9519
9521
  catch (e) {
9520
9522
  // Image is tainted, skip it
9521
- console.warn('Skipping cross-origin image:', img.src);
9523
+ console.warn("Skipping cross-origin image:", img.src);
9522
9524
  return true;
9523
9525
  }
9524
9526
  }