Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Commit aa8410a

Browse files
authored
Add puppeteer 15.5 and chromium 105
2 parents 869a523 + 0da7138 commit aa8410a

File tree

11 files changed

+46
-38
lines changed

11 files changed

+46
-38
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test:
1515
%.zip:
1616
npm install --no-fund --no-package-lock --no-shrinkwrap
1717
mkdir -p nodejs/
18-
npm install --prefix nodejs/ [email protected] puppeteer-core@14.4.1 --no-bin-links --no-fund --no-optional --no-package-lock --no-save --no-shrinkwrap
18+
npm install --prefix nodejs/ [email protected] puppeteer-core@15.5.0 --no-bin-links --no-fund --no-optional --no-package-lock --no-save --no-shrinkwrap
1919
npm pack
2020
mkdir -p nodejs/node_modules/@sparticuz/chrome-aws-lambda/
2121
tar --directory nodejs/node_modules/@sparticuz/chrome-aws-lambda/ --extract --file sparticuz-chrome-aws-lambda-*.tgz --strip-components=1

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ This package is versioned based on the underlying `puppeteer` minor version:
262262

263263
| `puppeteer` Version | `chrome-aws-lambda` Version | Chromium Revision |
264264
| ------------------- | --------------------------------------------- | ------------------------------------------------------- |
265+
| `15.4.*` | `npm i @sparticuz/chrome-aws-lambda@~15.5.0` | [`1022525`](https://crrev.com/1011831) (`105.0.5173.0`) |
265266
| `14.4.*` | `npm i @sparticuz/chrome-aws-lambda@~14.4.1` | [`1002410`](https://crrev.com/1002410) (`103.0.5058.0`) |
266267
| `14.3.*` | `npm i @sparticuz/chrome-aws-lambda@~14.3.0` | [`1002410`](https://crrev.com/1002410) (`103.0.5058.0`) |
267268
| `14.2.*` | `npm i @sparticuz/chrome-aws-lambda@~14.2.0` | [`1002410`](https://crrev.com/1002410) (`103.0.5058.0`) |

_/ansible/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.PHONY: ansible chromium
22

33
ansible:
4-
sudo pip3 install ansible boto boto3
4+
pip install ansible boto boto3
55

66
chromium:
77
ansible-playbook plays/chromium.yml -i inventory.ini

_/ansible/inventory.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[localhost:vars]
55
ansible_connection=local
66
ansible_python_interpreter=python
7-
image=ami-03425aeb2f345b9a9
7+
image=ami-0e7375e22561b4d0a
88
region=us-east-1
99

1010
[aws]
@@ -13,4 +13,4 @@ region=us-east-1
1313
ansible_connection=ssh
1414
ansible_python_interpreter=auto_silent
1515
ansible_ssh_private_key_file=ansible.pem
16-
puppeteer_version=v14.4.1
16+
puppeteer_version=v15.5.0

_/ansible/plays/chromium.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@
8383
PATH: "{{ ansible_env.PATH }}:/srv/source/depot_tools"
8484

8585
tasks:
86+
- name: Update system
87+
become: true
88+
become_user: root
89+
shell: |
90+
dnf update --releasever=2022.0.20220719 -y
91+
8692
- name: Installing Packages
8793
become: true
8894
become_user: root
@@ -93,7 +99,7 @@
9399
- atk-devel
94100
- bc
95101
- bluez-libs-devel
96-
- brlapi-devel
102+
# - brlapi-devel
97103
- bzip2-devel
98104
- cairo-devel
99105
- cmake
@@ -102,16 +108,16 @@
102108
- dbus-glib-devel
103109
- dbus-x11
104110
- expat-devel
105-
- glibc.i686
111+
- glibc
106112
- glibc-langpack-en
107113
- gperf
108114
- gtk3-devel
109115
- httpd
110-
- java-11-openjdk-devel
116+
- java-latest-openjdk-devel
111117
- libatomic
112118
- libcap-devel
113119
- libjpeg-devel
114-
- libstdc++.i686
120+
- libstdc++
115121
- libXScrnSaver-devel
116122
- libxkbcommon-x11-devel
117123
- mod_ssl
@@ -129,7 +135,7 @@
129135
- python-setuptools
130136
- ruby
131137
- xorg-x11-server-Xvfb
132-
- zlib.i686
138+
- zlib
133139
state: latest
134140
update_cache: true
135141

@@ -300,6 +306,7 @@
300306
symbol_level = 0
301307
target_cpu = "x64"
302308
target_os = "linux"
309+
use_brlapi = 0
303310
use_sysroot = true
304311
v8_symbol_level = 0
305312
v8_target_cpu = "x64"

bin/chromium.br

522 KB
Binary file not shown.

bin/swiftshader.tar.br

44.2 KB
Binary file not shown.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
"preversion": "npm run build"
2525
},
2626
"devDependencies": {
27-
"@types/node": "^16.11.40",
27+
"@types/node": "^16.11.45",
2828
"@types/tar-fs": "^2.0.1",
29-
"puppeteer-core": "14.4.1",
29+
"puppeteer-core": "15.5.0",
3030
"typescript": "^4.6.4"
3131
},
3232
"peerDependencies": {
33-
"puppeteer-core": "14.4.1"
33+
"puppeteer-core": "15.5.0"
3434
},
3535
"bugs": {
3636
"url": "https://github.com/Sparticuz/chrome-aws-lambda/issues"

source/puppeteer/lib/ElementHandle.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { ElementHandle, EvaluateFn, HTTPRequest, HTTPResponse, Page, WaitForOptions, WaitTimeoutOptions } from 'puppeteer-core';
2-
import { KeysOfType, Prototype } from '../../../typings/chrome-aws-lambda';
1+
import { ElementHandle, EvaluateFunc, HTTPRequest, HTTPResponse, Page, WaitForOptions, WaitTimeoutOptions } from 'puppeteer-core';
2+
import { Prototype } from '../../../typings/chrome-aws-lambda';
33

44
let Super: Prototype<ElementHandle> = null;
55

66
try {
7-
Super = require('puppeteer/lib/cjs/puppeteer/common/JSHandle.js').ElementHandle;
7+
Super = require('puppeteer/lib/cjs/puppeteer/common/ElementHandle.js').ElementHandle;
88
} catch (error) {
9-
Super = require('puppeteer-core/lib/cjs/puppeteer/common/JSHandle.js').ElementHandle;
9+
Super = require('puppeteer-core/lib/cjs/puppeteer/common/ElementHandle.js').ElementHandle;
1010
}
1111

1212
Super.prototype.clear = function () {
@@ -171,7 +171,7 @@ Super.prototype.fillFormByLabel = function <T extends Record<string, boolean | s
171171
return result;
172172
};
173173

174-
return this.evaluate(callback as unknown as EvaluateFn<Element>, data) as any;
174+
return this.evaluate(callback as unknown as EvaluateFunc<[ElementHandle<Element>, T]>, data) as any;
175175
};
176176

177177
Super.prototype.fillFormByName = function <T extends Record<string, boolean | string | string[]>>(data: T) {
@@ -262,7 +262,7 @@ Super.prototype.fillFormByName = function <T extends Record<string, boolean | st
262262
return result;
263263
};
264264

265-
return this.evaluate(callback as unknown as EvaluateFn<Element>, data) as any;
265+
return this.evaluate(callback as unknown as EvaluateFunc<[ElementHandle<Element>, T]>, data) as any;
266266
};
267267

268268
Super.prototype.fillFormBySelector = function <T extends Record<string, boolean | string | string[]>>(data: T) {
@@ -353,7 +353,7 @@ Super.prototype.fillFormBySelector = function <T extends Record<string, boolean
353353
return result;
354354
};
355355

356-
return this.evaluate(callback as unknown as EvaluateFn<Element>, data) as any;
356+
return this.evaluate(callback as unknown as EvaluateFunc<[ElementHandle<Element>, T]>, data) as any;
357357
};
358358

359359
Super.prototype.fillFormByXPath = function <T extends Record<string, boolean | string | string[]>>(data: T) {
@@ -450,7 +450,7 @@ Super.prototype.fillFormByXPath = function <T extends Record<string, boolean | s
450450
return result;
451451
};
452452

453-
return this.evaluate(callback as unknown as EvaluateFn<Element>, data) as any;
453+
return this.evaluate(callback as unknown as EvaluateFunc<[ElementHandle<Element>, T]>, data) as any;
454454
};
455455

456456
Super.prototype.getInnerHTML = function () {
@@ -465,8 +465,8 @@ Super.prototype.getInnerText = function () {
465465
});
466466
};
467467

468-
Super.prototype.number = function <T = HTMLElement>(decimal: string = '.', property: KeysOfType<T, string> = 'textContent' as any) {
469-
let callback = (node: T, decimal: string, property: KeysOfType<T, string>) => {
468+
Super.prototype.number = function (decimal: string = '.', property: any) {
469+
let callback = (node: any, decimal: string, property: any) => {
470470
let data = (node[property] as unknown) as string;
471471

472472
if (typeof data === 'string') {
@@ -486,7 +486,7 @@ Super.prototype.number = function <T = HTMLElement>(decimal: string = '.', prope
486486
return null;
487487
};
488488

489-
return this.evaluate(callback as unknown as EvaluateFn<Element>, decimal, property as any);
489+
return this.evaluate(callback, decimal, property as any);
490490
};
491491

492492
Super.prototype.selectByLabel = function (...values: string[]) {
@@ -523,11 +523,11 @@ Super.prototype.selectByLabel = function (...values: string[]) {
523523
return result;
524524
};
525525

526-
return this.evaluate(callback as unknown as EvaluateFn<Element>, values);
526+
return this.evaluate(callback as any, values);
527527
};
528528

529-
Super.prototype.string = function <T = HTMLElement>(property: KeysOfType<T, string> = 'textContent' as any) {
530-
let callback = (node: T, property: KeysOfType<T, string>) => {
529+
Super.prototype.string = function (property: any) {
530+
let callback = (node: any, property: any) => {
531531
let data = (node[property] as unknown) as string;
532532

533533
if (typeof data === 'string') {
@@ -553,5 +553,5 @@ Super.prototype.string = function <T = HTMLElement>(property: KeysOfType<T, stri
553553
return null;
554554
};
555555

556-
return this.evaluate(callback as unknown as EvaluateFn<Element>, property as any);
556+
return this.evaluate(callback, property as any);
557557
};

source/puppeteer/lib/FrameManager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Frame, HTTPRequest, HTTPResponse, Page, WaitForOptions, WaitTimeoutOptions } from 'puppeteer-core';
1+
import { Frame, HTTPRequest, HTTPResponse, WaitForOptions, WaitTimeoutOptions } from 'puppeteer-core';
22
import { KeysOfType, Prototype } from '../../../typings/chrome-aws-lambda';
33

44
let Super: Prototype<Frame> = null;
@@ -44,7 +44,7 @@ Super.prototype.clickAndWaitForRequest = function (selector: string, predicate:
4444
};
4545

4646
let promises: [Promise<HTTPRequest>, Promise<void>] = [
47-
((this._frameManager as any)._page as Page).waitForRequest((typeof predicate === 'function') ? predicate : callback, options),
47+
this.page().waitForRequest((typeof predicate === 'function') ? predicate : callback, options),
4848
this.click(selector),
4949
];
5050

@@ -67,7 +67,7 @@ Super.prototype.clickAndWaitForResponse = function (selector: string, predicate:
6767
};
6868

6969
let promises: [Promise<HTTPResponse>, Promise<void>] = [
70-
((this._frameManager as any)._page as Page).waitForResponse((typeof predicate === 'function') ? predicate : callback, options),
70+
this.page().waitForResponse((typeof predicate === 'function') ? predicate : callback, options),
7171
this.click(selector),
7272
];
7373

0 commit comments

Comments
 (0)