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', () => { `; }); - koaServer.get('/foo/bar/42.css?x=foo&y=%20baz', ctx => { + koaServer.get('/foo/bar/42.css', ctx => { ctx.statusCode = 500; }); koaServer.get('/baz/bar.png', ctx => { @@ -299,7 +299,7 @@ describe('basic resource tests', () => { `; }); - koaServer.get('/foo/bar/42.css?x=foo&y=%20baz', ctx => { + koaServer.get('/foo/bar/42.css', ctx => { ctx.statusCode = 500; }); koaServer.get('/baz/bar.png', ctx => { diff --git a/plugins/default-browser-emulator/test/proxyLeak.test.ts b/plugins/default-browser-emulator/test/proxyLeak.test.ts index e48a0e342..28f0b722d 100644 --- a/plugins/default-browser-emulator/test/proxyLeak.test.ts +++ b/plugins/default-browser-emulator/test/proxyLeak.test.ts @@ -536,7 +536,6 @@ test('string expansion trigger should not reveal different .toString location', }, }); - console.info(error); return { wrongStack, seenStackInName, nameStack }; } diff --git a/yarn.lock b/yarn.lock index c39bfcba1..1cacbfcee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1799,10 +1799,10 @@ dependencies: "@ulixee/js-path" "^2.0.0-alpha.18" -"@ulixee/chrome-124-0@^6367.208.10": - version "6367.208.10" - resolved "https://registry.yarnpkg.com/@ulixee/chrome-124-0/-/chrome-124-0-6367.208.10.tgz#32a874efdc837487d14899da721ced4b51b3a463" - integrity sha512-3rn8vdd5m+coAZXgBMkerqN+cC9RaYiK1HwXC36lKkK2csIsl6Ekc+PNCZyyl/i33p6Y1+sXVzRwR26Npr+0OA== +"@ulixee/chrome-128-0@^6613.138.11": + version "6613.138.11" + resolved "https://registry.yarnpkg.com/@ulixee/chrome-128-0/-/chrome-128-0-6613.138.11.tgz#9836f79a6f2ae4babe06f6fb34a706dfb632584c" + integrity sha512-efglwyxEq0UW/Qr6lvMi25aDwv8Ea4XwrLmd/MFPKAThZXI+vg6NoirT7lbtJ0RF02G6dvVX1OoEXnZH8rfQjg== dependencies: "@ulixee/chrome-app" "^1.0.3"