fix(route/javdb): respect proxy configuration (#22676)

This commit is contained in:
1sixth 2026-07-10 22:18:13 +08:00 committed by GitHub
parent 2b473cca31
commit b7e706df81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 17 additions and 17 deletions

View File

@ -18,23 +18,23 @@ const ProcessItems = async (ctx, currentUrl, title) => {
const rootUrl = `https://${domain}`;
const { page, destroy, context } = await getPlaywrightPage('about:blank');
if (config.javdb.session) {
await page.context().addCookies([
{
name: '_jdb_session',
value: config.javdb.session,
domain,
path: '/',
},
]);
}
await page.route('**/*', (route) => {
const request = route.request();
request.resourceType() === 'document' ? route.continue() : route.abort();
});
await page.goto(url.href, {
waitUntil: 'domcontentloaded',
const { page, destroy, context } = await getPlaywrightPage(url.href, {
onBeforeLoad: async (page) => {
if (config.javdb.session) {
await page.context().addCookies([
{
name: '_jdb_session',
value: config.javdb.session,
domain,
path: '/',
},
]);
}
await page.route('**/*', (route) => {
const request = route.request();
request.resourceType() === 'document' ? route.continue() : route.abort();
});
},
});
const response = await page.content();
await page.close();