样式修改

This commit is contained in:
谢宇宁
2026-10-16 14:10:10 +07:00
parent d2ddb1c321
commit 4afd5f9143
42 changed files with 89 additions and 1765 deletions
+3 -15
View File
@@ -26,7 +26,7 @@ try {
await context.route("**/*", async (route) => {
const request = route.request();
const local = new URL(request.url()).origin === origin;
// Exercise UI without recording synthetic analytics, purchases or user actions.
// Exercise UI without recording synthetic purchases or user actions.
if (
!local &&
(request.method() !== "GET" || request.resourceType() === "script")
@@ -55,12 +55,6 @@ try {
timeout: 40000,
});
await page.waitForTimeout(500);
if (path !== "/discover/search/")
await page.waitForFunction(
() => typeof (window as unknown as Record<string, unknown>).tracker === "object",
null,
{ timeout: 15000 },
);
for (let index = 0; index < 12; index++) {
const close = page.locator(
"[data-dialog-ad].hk-is-open [data-dialog-ad-item]:not([hidden]) [data-dialog-ad-close]",
@@ -75,9 +69,6 @@ try {
legacyScripts: Array.from(document.scripts).some((script) =>
/\/static\/js\//.test(script.src),
),
tracker:
typeof (window as unknown as Record<string, unknown>).tracker ===
"object",
}));
results.push({
device: name,
@@ -91,11 +82,8 @@ try {
throw new Error(
`${name} ${path} overflows horizontally: ${layout.document}`,
);
if (
layout.legacyScripts ||
(path !== "/discover/search/" && !layout.tracker)
)
throw new Error(`${name} ${path} missing shared client runtime`);
if (layout.legacyScripts)
throw new Error(`${name} ${path} loaded legacy business scripts`);
if (path === "/") {
const accountEntries = await page.locator(
"[data-login-open], [data-register-open], .hk-user-menu, a[href^='/account']",