@skrillex1224/playwright-toolkit 2.1.33 → 2.1.34

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.cjs CHANGED
@@ -325,6 +325,10 @@ var Utils = {
325
325
  if (el.scrollHeight > maxHeight) {
326
326
  maxHeight = el.scrollHeight;
327
327
  }
328
+ el.dataset.pkOrigOverflow = el.style.overflow;
329
+ el.dataset.pkOrigHeight = el.style.height;
330
+ el.dataset.pkOrigMaxHeight = el.style.maxHeight;
331
+ el.classList.add("__pk_expanded__");
328
332
  el.style.overflow = "visible";
329
333
  el.style.height = "auto";
330
334
  el.style.maxHeight = "none";
@@ -344,6 +348,17 @@ var Utils = {
344
348
  logger2.success("fullPageScreenshot", `captured ${Math.round(buffer_.length / 1024)} KB`);
345
349
  return buffer_.toString("base64");
346
350
  } finally {
351
+ await page.evaluate(() => {
352
+ document.querySelectorAll(".__pk_expanded__").forEach((el) => {
353
+ el.style.overflow = el.dataset.pkOrigOverflow || "";
354
+ el.style.height = el.dataset.pkOrigHeight || "";
355
+ el.style.maxHeight = el.dataset.pkOrigMaxHeight || "";
356
+ delete el.dataset.pkOrigOverflow;
357
+ delete el.dataset.pkOrigHeight;
358
+ delete el.dataset.pkOrigMaxHeight;
359
+ el.classList.remove("__pk_expanded__");
360
+ });
361
+ });
347
362
  if (originalViewport) {
348
363
  await page.setViewportSize(originalViewport);
349
364
  }