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

feat: update to chrome 117 #74

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions agent/main/lib/Frame.ts
Original file line number Diff line number Diff line change
@@ -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;
}
8 changes: 4 additions & 4 deletions agent/main/lib/Pool.ts
Original file line number Diff line number Diff line change
@@ -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();
}

2 changes: 1 addition & 1 deletion agent/main/package.json
Original file line number Diff line number Diff line change
@@ -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",
2 changes: 1 addition & 1 deletion agent/main/test/Frames.test.ts
Original file line number Diff line number Diff line change
@@ -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');
});
6 changes: 1 addition & 5 deletions agent/main/test/Page.navigate.test.ts
Original file line number Diff line number Diff line change
@@ -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 () => {
3 changes: 2 additions & 1 deletion plugins/default-browser-emulator/test/detection.test.ts
Original file line number Diff line number Diff line change
@@ -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(
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -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"