@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.
@@ -1,7 +1,7 @@
1
1
  declare class Screenshot {
2
2
  private currentScreenshot;
3
3
  constructor();
4
- capture(mode?: 'viewport' | 'fullpage'): Promise<string>;
4
+ capture(mode?: "viewport" | "fullpage"): Promise<string>;
5
5
  private hideUXbertElements;
6
6
  private showUXbertElements;
7
7
  getScreenshot(): string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/features/screenshot.ts"],"names":[],"mappings":"AAGA,cAAM,UAAU;IACd,OAAO,CAAC,iBAAiB,CAAgB;;IAMnC,OAAO,CAAC,IAAI,GAAE,UAAU,GAAG,UAAuB,GAAG,OAAO,CAAC,MAAM,CAAC;IA8G1E,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,kBAAkB;IAY1B,aAAa,IAAI,MAAM,GAAG,IAAI;IAI9B,KAAK,IAAI,IAAI;CAGd;AAED,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/features/screenshot.ts"],"names":[],"mappings":"AAGA,cAAM,UAAU;IACd,OAAO,CAAC,iBAAiB,CAAgB;;IAMnC,OAAO,CAAC,IAAI,GAAE,UAAU,GAAG,UAAuB,GAAG,OAAO,CAAC,MAAM,CAAC;IAiH1E,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,kBAAkB;IAY1B,aAAa,IAAI,MAAM,GAAG,IAAI;IAI9B,KAAK,IAAI,IAAI;CAGd;AAED,eAAe,UAAU,CAAC"}
@@ -9449,18 +9449,20 @@ class Screenshot {
9449
9449
  constructor() {
9450
9450
  this.currentScreenshot = null;
9451
9451
  }
9452
- async capture(mode = 'fullpage') {
9452
+ async capture(mode = "fullpage") {
9453
9453
  try {
9454
9454
  // Hide UXbert UI elements before capturing
9455
9455
  this.hideUXbertElements();
9456
9456
  const originalScrollY = window.scrollY;
9457
9457
  let canvas;
9458
- if (mode === 'viewport') {
9458
+ if (mode === "viewport") {
9459
9459
  // Capture only the current viewport
9460
9460
  canvas = await html2canvas(document.body, {
9461
+ // foreignObjectRendering: true,
9462
+ imageTimeout: 40000,
9461
9463
  useCORS: true,
9462
9464
  allowTaint: false,
9463
- logging: false,
9465
+ logging: true,
9464
9466
  width: window.innerWidth,
9465
9467
  height: window.innerHeight,
9466
9468
  windowWidth: window.innerWidth,
@@ -9469,12 +9471,12 @@ class Screenshot {
9469
9471
  y: window.scrollY,
9470
9472
  ignoreElements: (element) => {
9471
9473
  // Skip cross-origin images that might cause issues
9472
- if (element.tagName === 'IMG') {
9474
+ if (element.tagName === "IMG") {
9473
9475
  const img = element;
9474
9476
  try {
9475
9477
  // Test if image is accessible
9476
- const canvas = document.createElement('canvas');
9477
- const ctx = canvas.getContext('2d');
9478
+ const canvas = document.createElement("canvas");
9479
+ const ctx = canvas.getContext("2d");
9478
9480
  canvas.width = 1;
9479
9481
  canvas.height = 1;
9480
9482
  ctx?.drawImage(img, 0, 0, 1, 1);
@@ -9483,7 +9485,7 @@ class Screenshot {
9483
9485
  }
9484
9486
  catch (e) {
9485
9487
  // Image is tainted, skip it
9486
- console.warn('Skipping cross-origin image:', img.src);
9488
+ console.warn("Skipping cross-origin image:", img.src);
9487
9489
  return true;
9488
9490
  }
9489
9491
  }
@@ -9506,12 +9508,12 @@ class Screenshot {
9506
9508
  height: fullPageHeight,
9507
9509
  ignoreElements: (element) => {
9508
9510
  // Skip cross-origin images that might cause issues
9509
- if (element.tagName === 'IMG') {
9511
+ if (element.tagName === "IMG") {
9510
9512
  const img = element;
9511
9513
  try {
9512
9514
  // Test if image is accessible
9513
- const canvas = document.createElement('canvas');
9514
- const ctx = canvas.getContext('2d');
9515
+ const canvas = document.createElement("canvas");
9516
+ const ctx = canvas.getContext("2d");
9515
9517
  canvas.width = 1;
9516
9518
  canvas.height = 1;
9517
9519
  ctx?.drawImage(img, 0, 0, 1, 1);
@@ -9520,7 +9522,7 @@ class Screenshot {
9520
9522
  }
9521
9523
  catch (e) {
9522
9524
  // Image is tainted, skip it
9523
- console.warn('Skipping cross-origin image:', img.src);
9525
+ console.warn("Skipping cross-origin image:", img.src);
9524
9526
  return true;
9525
9527
  }
9526
9528
  }