diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml
index b5706fb97..e90b234b4 100644
--- a/.github/workflows/lint-and-test.yml
+++ b/.github/workflows/lint-and-test.yml
@@ -22,30 +22,12 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
node-version: [18, 20]
include:
- # - node-version: 20.x
- # os: ubuntu-latest
- # browser: chrome-123-0
- # - node-version: 20.x
- # os: ubuntu-latest
- # browser: chrome-122-0
- # - node-version: 20.x
- # os: ubuntu-latest
- # browser: chrome-121-0
+ - node-version: 20.x
+ os: ubuntu-latest
+ browser: chrome-125-0
- node-version: 20.x
os: ubuntu-latest
browser: chrome-120-0
- # - node-version: 20.x
- # os: ubuntu-latest
- # browser: chrome-119-0
- # - node-version: 20.x
- # os: ubuntu-latest
- # browser: chrome-118-0
- # - node-version: 20.x
- # os: ubuntu-latest
- # browser: chrome-117-0
- # - node-version: 20.x
- # os: ubuntu-latest
- # browser: chrome-116-0
- node-version: 20.x
os: ubuntu-latest
browser: chrome-115-0
diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml
index d8b6d6c98..d954bf661 100644
--- a/.github/workflows/release-test.yml
+++ b/.github/workflows/release-test.yml
@@ -20,7 +20,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
node-version: [18, 20]
include:
- - node-version: 18.x
+ - node-version: 20.x
os: ubuntu-latest
browser: chrome-114-0
diff --git a/agent/main/package.json b/agent/main/package.json
index acd619e54..31d1153cc 100644
--- a/agent/main/package.json
+++ b/agent/main/package.json
@@ -4,7 +4,7 @@
"description": "Fully programmable Devtools Protocol based browser",
"main": "index.js",
"dependencies": {
- "@ulixee/chrome-124-0": "^6367.208.10",
+ "@ulixee/chrome-128-0": "^6613.138.11",
"@ulixee/chrome-app": "^1.0.3",
"@ulixee/commons": "2.0.0-alpha.29",
"@ulixee/js-path": "2.0.0-alpha.29",
diff --git a/agent/main/test/Page.test.ts b/agent/main/test/Page.test.ts
index 0f29a0802..9f386b020 100644
--- a/agent/main/test/Page.test.ts
+++ b/agent/main/test/Page.test.ts
@@ -201,9 +201,13 @@ describe('Pages', () => {
`,
);
const screenshot = await page.screenshot({ format: 'png' });
- expect(screenshot.toString('base64')).toContain(
- 'iVBORw0KGgoAAAANSUhEUgAABAAAAAOECAYAAAA/m0PDAAAAAXNSR0IArs4c6QAAFjhJREFUeJzt2rENw0AMBEG9of5bpkuQEulh70zM4OIF18zMAQAAAPy1z+4BAAAAwPMEAAAAAAgQAAAAACBAAAAAAIAA',
- );
+
+ const viewport = await page.mainFrame.getWindowOffset();
+ expect(sizeOf(screenshot)).toStrictEqual({
+ width: viewport.innerWidth,
+ type: 'png',
+ height: viewport.innerHeight,
+ });
});
it('should screenshot only the visible page', async () => {
@@ -218,8 +222,6 @@ describe('Pages', () => {
type: 'jpg',
height: viewport.innerHeight,
});
- expect(sizeOf(screenshot).height).toBe(viewport.innerHeight);
- expect(sizeOf(screenshot).width).toBe(viewport.innerWidth);
});
it('should be able to take a clipped rect screenshot', async () => {
@@ -238,9 +240,7 @@ describe('Pages', () => {
scale: 1,
},
});
- expect(screenshot.toString('base64')).toContain(
- 'iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAYAAADL1t+KAAAAAXNSR0IArs4c6QAAB',
- );
+ expect(sizeOf(screenshot).height).toBe(500);
});
it('should be able to take a full page screenshot', async () => {
@@ -255,7 +255,6 @@ describe('Pages', () => {
jpegQuality: 1,
fullPage: true,
});
- expect(screenshot.toString('base64')).toContain('4AAQSkZJRgABAQAAAQABAAD');
expect(sizeOf(screenshot).height).toBe(2700);
});
@@ -276,9 +275,7 @@ describe('Pages', () => {
scale: 1,
},
});
- expect(screenshot.toString('base64')).toContain(
- 'AA0IHgAGhA8CA0AFgQOgAMCB0ABgQOgAMCB0ABoQOAANCB4ABoQPAgNABYEDoADAgdAAYEDoADAgdAAaEDgADQgeAAaEDwIDQAWBA6AAwIHQAGBA6AAwIHQAGhA4AA0IHgAGhA8CA0AFgQOgAMCB0ABgQOgAMCB0ABoQOAANCB4ABoQPAgNAB',
- );
+ expect(sizeOf(screenshot).height).toBe(2700);
});
});
diff --git a/agent/mitm/lib/MitmRequestAgent.ts b/agent/mitm/lib/MitmRequestAgent.ts
index 5156dee75..f17a6e38d 100644
--- a/agent/mitm/lib/MitmRequestAgent.ts
+++ b/agent/mitm/lib/MitmRequestAgent.ts
@@ -249,12 +249,13 @@ export default class MitmRequestAgent {
}
});
- let callbackArgs: any[];
+ let responseCallbackArgs: any[];
+ let upgradeCallbackArgs: any[];
request.once('response', (...args: any[]) => {
- callbackArgs = args;
+ responseCallbackArgs = args;
});
request.once('upgrade', (...args: any[]) => {
- callbackArgs = args;
+ upgradeCallbackArgs = args;
});
// we have to rebroadcast because this function is async, so the handlers can register late
@@ -262,9 +263,13 @@ export default class MitmRequestAgent {
event: string,
handler: (...args: any[]) => void,
): http.ClientRequest => {
- if ((event === 'response' || event === 'upgrade') && callbackArgs) {
- handler(...callbackArgs);
- callbackArgs = null;
+ if (event === 'response' && responseCallbackArgs) {
+ handler(...responseCallbackArgs);
+ responseCallbackArgs = null;
+ }
+ if (event === 'upgrade' && upgradeCallbackArgs) {
+ handler(...upgradeCallbackArgs);
+ upgradeCallbackArgs = null;
}
// hand off to another fn
if (event === 'error') this.events.off(flushListener);
diff --git a/end-to-end/test/resources.test.ts b/end-to-end/test/resources.test.ts
index 10302f09b..6747334c6 100644
--- a/end-to-end/test/resources.test.ts
+++ b/end-to-end/test/resources.test.ts
@@ -265,7 +265,7 @@ describe('basic resource tests', () => {