diff --git a/docs/contributing.md b/docs/contributing.md index f58743b9b6c..3fd4a05ee91 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -266,9 +266,9 @@ The following steps are needed to update the Chromium version. number. 3. Update `versions.js` with the new Chromium-to-Puppeteer version mapping and update `lastMaintainedChromiumVersion` with the latest stable Chrome version. -4. Run `npm run check:protocol-revision`. If it fails, update `package.json` +4. Run `npm run check`. If it fails, update `packages/puppeteer-core/package.json` and `packages/puppeteer/package.json` with the expected `devtools-protocol` version. -5. Run `npm run build` and `npm install`. +5. Run `npm run clean`, `npm run build` and `npm install`. 6. Run `npm test` and ensure that all tests pass. If a test fails, [bisect](#bisecting-upstream-changes) the upstream cause of the failure, and either update the test expectations accordingly (if it was an intended diff --git a/package-lock.json b/package-lock.json index 5a7c3603b13..bf6a23285e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3041,9 +3041,9 @@ } }, "node_modules/devtools-protocol": { - "version": "0.0.1045489", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1045489.tgz", - "integrity": "sha512-D+PTmWulkuQW4D1NTiCRCFxF7pQPn0hgp4YyX4wAQ6xYXKOadSWPR3ENGDQ47MW/Ewc9v2rpC/UEEGahgBYpSQ==" + "version": "0.0.1056733", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1056733.tgz", + "integrity": "sha512-CmTu6SQx2g3TbZzDCAV58+LTxVdKplS7xip0g5oDXpZ+isr0rv5dDP8ToyVRywzPHkCCPKgKgScEcwz4uPWDIA==" }, "node_modules/diff": { "version": "5.1.0", @@ -8469,6 +8469,7 @@ "license": "Apache-2.0", "dependencies": { "cosmiconfig": "7.0.1", + "devtools-protocol": "0.0.1056733", "https-proxy-agent": "5.0.1", "progress": "2.0.3", "proxy-from-env": "1.1.0", @@ -8484,7 +8485,7 @@ "dependencies": { "cross-fetch": "3.1.5", "debug": "4.3.4", - "devtools-protocol": "0.0.1045489", + "devtools-protocol": "0.0.1056733", "extract-zip": "2.0.1", "https-proxy-agent": "5.0.1", "proxy-from-env": "1.1.0", @@ -10616,9 +10617,9 @@ } }, "devtools-protocol": { - "version": "0.0.1045489", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1045489.tgz", - "integrity": "sha512-D+PTmWulkuQW4D1NTiCRCFxF7pQPn0hgp4YyX4wAQ6xYXKOadSWPR3ENGDQ47MW/Ewc9v2rpC/UEEGahgBYpSQ==" + "version": "0.0.1056733", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1056733.tgz", + "integrity": "sha512-CmTu6SQx2g3TbZzDCAV58+LTxVdKplS7xip0g5oDXpZ+isr0rv5dDP8ToyVRywzPHkCCPKgKgScEcwz4uPWDIA==" }, "diff": { "version": "5.1.0", @@ -13298,6 +13299,7 @@ "version": "file:packages/puppeteer", "requires": { "cosmiconfig": "7.0.1", + "devtools-protocol": "0.0.1056733", "https-proxy-agent": "5.0.1", "progress": "2.0.3", "proxy-from-env": "1.1.0", @@ -13309,7 +13311,7 @@ "requires": { "cross-fetch": "3.1.5", "debug": "4.3.4", - "devtools-protocol": "0.0.1045489", + "devtools-protocol": "0.0.1056733", "extract-zip": "2.0.1", "https-proxy-agent": "5.0.1", "proxy-from-env": "1.1.0", diff --git a/packages/puppeteer-core/package.json b/packages/puppeteer-core/package.json index 5f3744434f6..6609e8013a1 100644 --- a/packages/puppeteer-core/package.json +++ b/packages/puppeteer-core/package.json @@ -152,7 +152,7 @@ "dependencies": { "cross-fetch": "3.1.5", "debug": "4.3.4", - "devtools-protocol": "0.0.1045489", + "devtools-protocol": "0.0.1056733", "extract-zip": "2.0.1", "https-proxy-agent": "5.0.1", "proxy-from-env": "1.1.0", diff --git a/packages/puppeteer-core/src/common/Page.ts b/packages/puppeteer-core/src/common/Page.ts index 9deef405588..e1fbedcbc59 100644 --- a/packages/puppeteer-core/src/common/Page.ts +++ b/packages/puppeteer-core/src/common/Page.ts @@ -2533,14 +2533,8 @@ export class CDPPage extends Page { targetId: this.#target._targetId, }); let clip = options.clip ? processClip(options.clip) : undefined; - const captureBeyondViewport = - typeof options.captureBeyondViewport === 'boolean' - ? options.captureBeyondViewport - : true; - const fromSurface = - typeof options.fromSurface === 'boolean' - ? options.fromSurface - : undefined; + let captureBeyondViewport = options.captureBeyondViewport ?? true; + const fromSurface = options.fromSurface; if (options.fullPage) { const metrics = await this.#client.send('Page.getLayoutMetrics'); @@ -2548,7 +2542,7 @@ export class CDPPage extends Page { const {width, height} = metrics.cssContentSize || metrics.contentSize; // Overwrite clip for full page. - clip = {x: 0, y: 0, width, height, scale: 1}; + clip = undefined; if (!captureBeyondViewport) { const { @@ -2568,7 +2562,10 @@ export class CDPPage extends Page { screenOrientation, }); } + } else if (!clip) { + captureBeyondViewport = false; } + const shouldSetDefaultBackground = options.omitBackground && (format === 'png' || format === 'webp'); if (shouldSetDefaultBackground) { @@ -2578,12 +2575,10 @@ export class CDPPage extends Page { const result = await this.#client.send('Page.captureScreenshot', { format, quality: options.quality, - clip: clip - ? { - ...clip, - scale: clip.scale === undefined ? 1 : clip.scale, - } - : undefined, + clip: clip && { + ...clip, + scale: clip.scale ?? 1, + }, captureBeyondViewport, fromSurface, }); diff --git a/packages/puppeteer-core/src/revisions.ts b/packages/puppeteer-core/src/revisions.ts index 50f0456c79c..c874cacec36 100644 --- a/packages/puppeteer-core/src/revisions.ts +++ b/packages/puppeteer-core/src/revisions.ts @@ -18,6 +18,6 @@ * @internal */ export const PUPPETEER_REVISIONS = Object.freeze({ - chromium: '1045629', + chromium: '1056772', firefox: 'latest', }); diff --git a/packages/puppeteer/package.json b/packages/puppeteer/package.json index caa8cc5e86e..ae54b9147c4 100644 --- a/packages/puppeteer/package.json +++ b/packages/puppeteer/package.json @@ -136,6 +136,7 @@ "license": "Apache-2.0", "dependencies": { "cosmiconfig": "7.0.1", + "devtools-protocol": "0.0.1056733", "https-proxy-agent": "5.0.1", "progress": "2.0.3", "proxy-from-env": "1.1.0", diff --git a/test/golden-chromium/vision-deficiency-blurredVision.png b/test/golden-chromium/vision-deficiency-blurredVision.png index 0efb9ca066a..78979425a97 100644 Binary files a/test/golden-chromium/vision-deficiency-blurredVision.png and b/test/golden-chromium/vision-deficiency-blurredVision.png differ diff --git a/test/src/accessibility.spec.ts b/test/src/accessibility.spec.ts index 088c33013b0..3f4ec0163fe 100644 --- a/test/src/accessibility.spec.ts +++ b/test/src/accessibility.spec.ts @@ -278,7 +278,7 @@ describe('Accessibility', function () { children: [ { role: 'text leaf', - name: 'Edit this image: ', + name: 'Edit this image:', }, { role: 'StaticText', @@ -293,7 +293,7 @@ describe('Accessibility', function () { children: [ { role: 'StaticText', - name: 'Edit this image:', + name: 'Edit this image: ', }, { role: 'img', @@ -334,7 +334,7 @@ describe('Accessibility', function () { children: [ { role: 'StaticText', - name: 'Edit this image:', + name: 'Edit this image: ', }, ], }; diff --git a/tools/check_availability.js b/tools/check_availability.js index 8937b6a4a9a..74097951a19 100755 --- a/tools/check_availability.js +++ b/tools/check_availability.js @@ -248,7 +248,7 @@ async function checkRangeAvailability({ } const fetchers = platforms.map(platform => { - return new BrowserFetcher('', {platform}); + return new BrowserFetcher({platform}); }); const inc = fromRevision < toRevision ? 1 : -1; diff --git a/versions.js b/versions.js index 50164518eca..e7c4cdf51d5 100644 --- a/versions.js +++ b/versions.js @@ -17,6 +17,7 @@ const versionsPerRelease = new Map([ // This is a mapping from Chromium version => Puppeteer version. // In Chromium roll patches, use `NEXT` for the Puppeteer version. + ['108.0.5351.0', 'NEXT'], ['107.0.5296.0', 'v18.1.0'], ['106.0.5249.0', 'v17.1.0'], ['105.0.5173.0', 'v15.5.0'], @@ -52,7 +53,7 @@ const versionsPerRelease = new Map([ ]); // The same major version as the current Chrome Stable per https://chromestatus.com/roadmap. -const lastMaintainedChromiumVersion = '103.0.5059.0'; +const lastMaintainedChromiumVersion = '106.0.5249.0'; if (!versionsPerRelease.has(lastMaintainedChromiumVersion)) { throw new Error(