@skrillex1224/playwright-toolkit 2.1.160 → 2.1.161

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.js CHANGED
@@ -396,6 +396,8 @@ function createInternalLogger(moduleName, explicitLogger) {
396
396
  // src/internals/screenshot.js
397
397
  var logger = createInternalLogger("Screenshot");
398
398
  var DEFAULT_TIMEOUT_MS = 5e3;
399
+ var FORCED_FULLPAGE_TYPE = "jpeg";
400
+ var FORCED_FULLPAGE_QUALITY = 50;
399
401
  var SUPPORTED_TYPES = /* @__PURE__ */ new Set(["png", "jpeg", "webp"]);
400
402
  var toPositiveNumber = (value, fallback = 0) => {
401
403
  const n = Number(value);
@@ -431,9 +433,9 @@ var buildFullPageClip = (metrics, viewport, maxClipHeight) => {
431
433
  };
432
434
  };
433
435
  var capturePageScreenshot = async (page, options = {}) => {
434
- const type = normalizeType(options.type);
435
- const quality = normalizeQuality(options.quality, type);
436
436
  const fullPage = Boolean(options.fullPage);
437
+ const type = fullPage ? FORCED_FULLPAGE_TYPE : normalizeType(options.type);
438
+ const quality = fullPage ? FORCED_FULLPAGE_QUALITY : normalizeQuality(options.quality, type);
437
439
  const timeout = toPositiveNumber(options.timeout, DEFAULT_TIMEOUT_MS);
438
440
  const maxClipHeight = Math.round(toPositiveNumber(options.maxClipHeight, 0));
439
441
  const fallbackOptions = {