Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:

- name: Build and toolchain regressions / 构建及工具链回归
working-directory: desktop
run: node --test scripts/check-built-syntax.test.mjs scripts/check-monaco-sanitizer.test.mjs scripts/check-jsdom-undici.test.mjs scripts/check-source-map.test.mjs scripts/check-nanoid.test.mjs scripts/check-browserslist.test.mjs scripts/windows-resource-reporter.test.mjs
run: node --test scripts/check-built-syntax.test.mjs scripts/check-monaco-sanitizer.test.mjs scripts/check-jsdom-undici.test.mjs scripts/check-source-map.test.mjs scripts/check-nanoid.test.mjs scripts/check-browserslist.test.mjs scripts/windows-resource-reporter.test.mjs scripts/check-playwright-windows-socket.test.mjs

- name: Documentation artifact isolation / 文档产物隔离
working-directory: desktop
Expand Down
3 changes: 2 additions & 1 deletion desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
"monaco-editor@0.54.0>dompurify": "3.4.17"
},
"patchedDependencies": {
"monaco-editor@0.54.0": "patches/monaco-editor@0.54.0.patch"
"monaco-editor@0.54.0": "patches/monaco-editor@0.54.0.patch",
"playwright-core@1.61.0": "patches/playwright-core@1.61.0.patch"
}
}
}
13 changes: 13 additions & 0 deletions desktop/patches/playwright-core@1.61.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lib/coreBundle.js b/lib/coreBundle.js
index 1d36a373cb14a856c9a69e218df5183bb250d2f0..30a4e53f61e91f359f02a08d2a647bd80d368b48 100644
--- a/lib/coreBundle.js
+++ b/lib/coreBundle.js
@@ -34423,6 +34423,8 @@ var init_chromiumSwitches = __esm({
"AutoDeElevate",
// See https://github.com/microsoft/playwright/issues/37714
"RenderDocument",
+ // Backport Playwright #43605 for Windows loopback errors. / 回移 Playwright #43605,缓解 Windows 本地回环错误。
+ "TcpPortRandomizationWin",
// Prevents downloading optimization hints on startup.
"OptimizationHints",
// Disables forced sign-in in Edge.
7 changes: 5 additions & 2 deletions desktop/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions desktop/scripts/check-playwright-windows-socket.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { spawnSync } from "node:child_process";
import { test } from "node:test";
import assert from "node:assert/strict";
import { fileURLToPath } from "node:url";

test("Playwright preserves its defaults and disables Windows TCP port randomization / Playwright 保留默认设置并禁用 Windows TCP 端口随机化", () => {
// Node exits on Chromium's flags without starting a browser or server. / Node 遇到 Chromium 参数即退出,不启动浏览器或服务器。
const launch = `
const { chromium } = require('@playwright/test');
chromium.launch({ executablePath: process.execPath }).catch(() => {});
`;
const result = spawnSync(process.execPath, ["-e", launch], {
cwd: fileURLToPath(new URL("..", import.meta.url)),
env: { ...process.env, DEBUG: "pw:browser" },
encoding: "utf8",
timeout: 15_000,
});
assert.equal(result.error, undefined);
assert.equal(result.status, 0);
const line = result.stderr.split(/\r?\n/).find((entry) => entry.includes("<launching>"));
assert.ok(line, "launch arguments are available / 可读取启动参数");
const featureArgs = [...line.matchAll(/(?:^|\s)--disable-features=([^\s]+)/g)];
assert.equal(featureArgs.length, 1, "one effective feature list / 仅有一个生效的特性列表");
const features = new Set(featureArgs[0][1].split(","));
for (const feature of [
"AvoidUnnecessaryBeforeUnloadCheckSync",
"BoundaryEventDispatchTracksNodeRemoval",
"DestroyProfileOnBrowserClose",
"DialMediaRouteProvider",
"GlobalMediaControls",
"HttpsUpgrades",
"LensOverlay",
"MediaRouter",
"PaintHolding",
"ThirdPartyStoragePartitioning",
"Translate",
"AutoDeElevate",
"RenderDocument",
"OptimizationHints",
"msForceBrowserSignIn",
"msEdgeUpdateLaunchServicesPreferredVersion",
"TcpPortRandomizationWin",
]) {
assert.ok(features.has(feature), `missing feature / 缺少特性: ${feature}`);
}
});
Loading