@devskin/browser-sdk 1.0.23 → 1.0.24

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 +1 @@
1
- {"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/collectors/screenshot.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,qBAAa,mBAAmB;IAI5B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,SAAS;IAJnB,OAAO,CAAC,QAAQ,CAAS;gBAGf,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,SAAS;IAG9B;;OAEG;IACG,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAmExE"}
1
+ {"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/collectors/screenshot.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,qBAAa,mBAAmB;IAI5B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,SAAS;IAJnB,OAAO,CAAC,QAAQ,CAAS;gBAGf,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,SAAS;IAG9B;;OAEG;IACG,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CA+ExE"}
@@ -8933,21 +8933,30 @@ class ScreenshotCollector {
8933
8933
  if (this.config.debug) {
8934
8934
  console.log('[DevSkin] Capturing page screenshot...');
8935
8935
  }
8936
+ // Scroll to top before capturing
8937
+ const originalScrollY = window.scrollY;
8938
+ window.scrollTo(0, 0);
8939
+ // Wait for scroll to complete
8940
+ yield new Promise(resolve => setTimeout(resolve, 100));
8936
8941
  // Get full page dimensions
8937
8942
  const fullWidth = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth, document.body.offsetWidth, document.documentElement.offsetWidth, document.body.clientWidth, document.documentElement.clientWidth);
8938
8943
  const fullHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight);
8939
- const canvas = yield html2canvas(document.body, {
8944
+ const canvas = yield html2canvas(document.documentElement, {
8940
8945
  allowTaint: true,
8941
8946
  useCORS: true,
8942
8947
  logging: false,
8943
8948
  scale: 0.5, // Reduce size
8944
8949
  width: fullWidth,
8945
- height: fullHeight, // Capture ENTIRE page
8950
+ height: fullHeight,
8946
8951
  windowWidth: fullWidth,
8947
8952
  windowHeight: fullHeight,
8953
+ scrollY: 0,
8954
+ scrollX: 0,
8948
8955
  x: 0,
8949
8956
  y: 0,
8950
8957
  });
8958
+ // Restore scroll position
8959
+ window.scrollTo(0, originalScrollY);
8951
8960
  // Convert to base64 JPEG (smaller than PNG)
8952
8961
  const screenshot = canvas.toDataURL('image/jpeg', 0.6);
8953
8962
  // Send to backend