@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.cjs +4 -2
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +4 -2
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -423,6 +423,8 @@ function createInternalLogger(moduleName, explicitLogger) {
|
|
|
423
423
|
// src/internals/screenshot.js
|
|
424
424
|
var logger = createInternalLogger("Screenshot");
|
|
425
425
|
var DEFAULT_TIMEOUT_MS = 5e3;
|
|
426
|
+
var FORCED_FULLPAGE_TYPE = "jpeg";
|
|
427
|
+
var FORCED_FULLPAGE_QUALITY = 50;
|
|
426
428
|
var SUPPORTED_TYPES = /* @__PURE__ */ new Set(["png", "jpeg", "webp"]);
|
|
427
429
|
var toPositiveNumber = (value, fallback = 0) => {
|
|
428
430
|
const n = Number(value);
|
|
@@ -458,9 +460,9 @@ var buildFullPageClip = (metrics, viewport, maxClipHeight) => {
|
|
|
458
460
|
};
|
|
459
461
|
};
|
|
460
462
|
var capturePageScreenshot = async (page, options = {}) => {
|
|
461
|
-
const type = normalizeType(options.type);
|
|
462
|
-
const quality = normalizeQuality(options.quality, type);
|
|
463
463
|
const fullPage = Boolean(options.fullPage);
|
|
464
|
+
const type = fullPage ? FORCED_FULLPAGE_TYPE : normalizeType(options.type);
|
|
465
|
+
const quality = fullPage ? FORCED_FULLPAGE_QUALITY : normalizeQuality(options.quality, type);
|
|
464
466
|
const timeout = toPositiveNumber(options.timeout, DEFAULT_TIMEOUT_MS);
|
|
465
467
|
const maxClipHeight = Math.round(toPositiveNumber(options.maxClipHeight, 0));
|
|
466
468
|
const fallbackOptions = {
|