diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index d11b77e99..0e29ca44c 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -21,13 +21,13 @@ jobs: include: - node-version: 18.x os: ubuntu-latest - browser: chrome-113-0 + browser: chrome-116-0 - node-version: 18.x os: ubuntu-latest - browser: chrome-111-0 + browser: chrome-115-0 - node-version: 18.x os: ubuntu-latest - browser: chrome-109-0 + browser: chrome-113-0 - node-version: 18.x os: ubuntu-latest browser: chrome-103-0 diff --git a/agent/main/lib/Frame.ts b/agent/main/lib/Frame.ts index e810881c3..3e8997502 100644 --- a/agent/main/lib/Frame.ts +++ b/agent/main/lib/Frame.ts @@ -858,6 +858,10 @@ export default class Frame extends TypedEventEmitter implements IF private updateUrl(): void { if (this.internalFrame.url) { this.url = this.internalFrame.url + (this.internalFrame.urlFragment ?? ''); + + if (this.url.startsWith('data:') && !this.url.startsWith('data://')) { + this.url = `data://${this.url.substr('data:'.length)}`; + } } else { this.url = undefined; } diff --git a/agent/main/lib/Pool.ts b/agent/main/lib/Pool.ts index eba0365e0..1a3011053 100644 --- a/agent/main/lib/Pool.ts +++ b/agent/main/lib/Pool.ts @@ -103,7 +103,7 @@ export default class Pool extends TypedEventEmitter<{ }); if (this.hasAvailability) { - await this.waitForAgentClose(agent); + this.registerActiveAgent(agent); return; } @@ -216,7 +216,7 @@ export default class Pool extends TypedEventEmitter<{ } } - protected waitForAgentClose(agent: Agent): void { + protected registerActiveAgent(agent: Agent): void { this.#activeAgentsCount += 1; try { this.events.once(agent, 'close', this.onAgentClosed.bind(this, agent.id)); @@ -231,7 +231,7 @@ export default class Pool extends TypedEventEmitter<{ this.#activeAgentsCount -= 1; this.agentsById.delete(closedAgentId); - this.logger.info('ReleasingAgent', { + this.logger.info('Pool.ReleasingAgent', { maxConcurrentAgents: this.maxConcurrentAgents, activeAgentsCount: this.activeAgentsCount, waitingForAvailability: this.#waitingForAvailability.length, @@ -242,7 +242,7 @@ export default class Pool extends TypedEventEmitter<{ const { agent, promise } = this.#waitingForAvailability.shift(); - this.waitForAgentClose(agent); + this.registerActiveAgent(agent); promise.resolve(); } diff --git a/agent/main/package.json b/agent/main/package.json index 7326e39ca..38c295d00 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-114-0": "^5735.91.8", + "@ulixee/chrome-117-0": "^5938.89.8", "@ulixee/chrome-app": "^1.0.3", "@ulixee/commons": "2.0.0-alpha.24", "@ulixee/js-path": "2.0.0-alpha.24", diff --git a/agent/main/test/Frames.test.ts b/agent/main/test/Frames.test.ts index af98f026c..5bc24be0c 100644 --- a/agent/main/test/Frames.test.ts +++ b/agent/main/test/Frames.test.ts @@ -317,7 +317,7 @@ describe('Frames', () => { ``, ); expect(page.frames).toHaveLength(2); - await page.frames[1].waitForNavigationLoader(); + await new Promise(resolve => setTimeout(resolve, 1e3)); // CHROME redirects to chrome-error://chromewebdata/, not sure about other browsers expect(page.frames[1].url).not.toMatch('/x-frame-options-deny.html'); }); diff --git a/agent/main/test/Page.navigate.test.ts b/agent/main/test/Page.navigate.test.ts index 1e48486d5..b91b85dad 100644 --- a/agent/main/test/Page.navigate.test.ts +++ b/agent/main/test/Page.navigate.test.ts @@ -137,11 +137,7 @@ describe('Page.navigate', () => { await page.goto('data:text/html,hello'); const nodeVersion = process.version.replace('v', '').split('.').map(Number); - if (nodeVersion[0] >= 18) { - expect(page.mainFrame.url).toBe('data://text/html,hello'); - } else { - expect(page.mainFrame.url).toBe('data:text/html,hello'); - } + expect(page.mainFrame.url).toBe('data://text/html,hello'); }); it('should set last url in redirect chain', async () => { diff --git a/plugins/default-browser-emulator/test/detection.test.ts b/plugins/default-browser-emulator/test/detection.test.ts index 11ec472b2..51b2d5f3d 100644 --- a/plugins/default-browser-emulator/test/detection.test.ts +++ b/plugins/default-browser-emulator/test/detection.test.ts @@ -471,7 +471,8 @@ test('stack overflow test should match chrome', async () => { at iWillBetrayYouWithMyLongName (${koaServer.baseUrl}/betrayal:5:9)`; if ( (browserVersion < 112 && browserVersion > 97) || - (browserVersion > 112 && platform() !== 'darwin') + (browserVersion > 112 && browserVersion < 117 && platform() !== 'darwin')|| + (browserVersion >= 117 && platform() !== 'win32') ) { // replace first line only pre-112 stack = stack.replace( diff --git a/yarn.lock b/yarn.lock index 04dce7a89..f38673801 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2233,10 +2233,10 @@ dependencies: "@ulixee/chrome-app" "^1.0.3" -"@ulixee/chrome-114-0@^5735.91.8": - version "5735.199.8" - resolved "https://registry.yarnpkg.com/@ulixee/chrome-114-0/-/chrome-114-0-5735.199.8.tgz#670c379f0e2a9a7d202148a907b97f4d8a94421d" - integrity sha512-zjau/ScbH6M7NdnWu9+RIJfaG13Kg7H2JRCafzNKzN2AetT37bOPHCthE3WRLZXZ+7nzTPA8NvYm8tKKyp6pyg== +"@ulixee/chrome-117-0@^5938.89.8": + version "5938.89.8" + resolved "https://registry.yarnpkg.com/@ulixee/chrome-117-0/-/chrome-117-0-5938.89.8.tgz#d47ea993efda3f98e73f8336ab69e192b4e8d97c" + integrity sha512-OnssUVq/bMrRlKFYMOtfI+6fYZBuZzvLLwISPdR8jWdPg57VtLhOwB7joUL/UkPqX1Ne0uO6cKDgyk7GiTB2cg== dependencies: "@ulixee/chrome-app" "^1.0.3"