Skip to content

Commit 598913c

Browse files
committed
1 parent 923fd74 commit 598913c

File tree

4 files changed

+24
-9
lines changed

4 files changed

+24
-9
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
node_modules/
2-
.env.local
2+
.env.local*
33
screenshots

bypasscf.js

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,20 @@ async function launchBrowserForUser(username, password) {
165165
page.on("load", async () => {
166166
// await page.evaluate(externalScript); //因为这个是在页面加载好之后执行的,而脚本是在页面加载好时刻来判断是否要执行,由于已经加载好了,脚本就不会起作用
167167
});
168-
await page.goto("https://linux.do/t/topic/13716/285", {
169-
waitUntil: "domcontentloaded",
170-
});
168+
// 如果是Linuxdo,就导航到我的帖子
169+
if (loginUrl == "https://linux.do") {
170+
await page.goto("https://linux.do/t/topic/13716/340", {
171+
waitUntil: "domcontentloaded",
172+
});
173+
} else if (loginUrl == "https://meta.appinn.net") {
174+
await page.goto("https://meta.appinn.net/t/topic/52006", {
175+
waitUntil: "domcontentloaded",
176+
});
177+
} else {
178+
await page.goto(`${loginUrl}/t/topic/1`, {
179+
waitUntil: "domcontentloaded",
180+
});
181+
}
171182
} catch (err) {
172183
console.log(err);
173184
}
@@ -192,10 +203,10 @@ async function login(page, username, password) {
192203
console.log("Login button not found.");
193204
}
194205
});
195-
if (!loginButton) {
196-
await page.goto(`${loginUrl}/t/topic/1`, { waitUntil: "domcontentloaded" });
197-
await page.click(".discourse-reactions-reaction-button");
198-
}
206+
// if (!loginButton) {
207+
// await page.goto(`${loginUrl}/t/topic/1`, { waitUntil: "domcontentloaded" });
208+
// await page.click(".discourse-reactions-reaction-button");
209+
// }
199210
// 等待用户名输入框加载
200211
await page.waitForSelector("#login-account-name");
201212
// 模拟人类在找到输入框后的短暂停顿
@@ -257,7 +268,7 @@ async function navigatePage(url, page, browser) {
257268
await browser.close();
258269
return; // 超时则退出函数
259270
}
260-
}
271+
}
261272
console.log("页面标题:", pageTitle);
262273
}
263274

external.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@
336336
// 如果是Linuxdo,就导航到我的帖子
337337
if (BASE_URL == "https://linux.do") {
338338
window.location.href = "https://linux.do/t/topic/13716/340";
339+
} else if (BASE_URL == "https://meta.appinn.net") {
340+
window.location.href = "https://meta.appinn.net/t/topic/52006";
339341
} else {
340342
window.location.href = `${BASE_URL}/t/topic/1`;
341343
}

index_passage_list.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@
336336
// 如果是Linuxdo,就导航到我的帖子
337337
if (BASE_URL == "https://linux.do") {
338338
window.location.href = "https://linux.do/t/topic/13716/340";
339+
} else if (BASE_URL == "https://meta.appinn.net") {
340+
window.location.href = "https://meta.appinn.net/t/topic/52006";
339341
} else {
340342
window.location.href = `${BASE_URL}/t/topic/1`;
341343
}

0 commit comments

Comments
 (0)