Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
feat: update to chrome 117 (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
blakebyrnes authored Sep 27, 2023
1 parent 0d7b8af commit 2d9c416
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions agent/main/lib/Frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,10 @@ export default class Frame extends TypedEventEmitter<IFrameEvents> 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;
}
Expand Down
8 changes: 4 additions & 4 deletions agent/main/lib/Pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default class Pool extends TypedEventEmitter<{
});

if (this.hasAvailability) {
await this.waitForAgentClose(agent);
this.registerActiveAgent(agent);
return;
}

Expand Down Expand Up @@ -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));
Expand All @@ -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,
Expand All @@ -242,7 +242,7 @@ export default class Pool extends TypedEventEmitter<{

const { agent, promise } = this.#waitingForAvailability.shift();

this.waitForAgentClose(agent);
this.registerActiveAgent(agent);
promise.resolve();
}

Expand Down
2 changes: 1 addition & 1 deletion agent/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion agent/main/test/Frames.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ describe('Frames', () => {
`<iframe src="${server.crossProcessBaseUrl}/x-frame-options-deny.html"></iframe>`,
);
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');
});
Expand Down
6 changes: 1 addition & 5 deletions agent/main/test/Page.navigate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
3 changes: 2 additions & 1 deletion plugins/default-browser-emulator/test/detection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 2d9c416

Please sign in to comment.