优化浏览器

This commit is contained in:
Jerry 2025-05-17 12:36:19 +08:00
parent c870d6605e
commit 0a43014142

View File

@ -20,7 +20,10 @@ const screenshot = {
.replace('{{feedTitle}}', feedItem.feedTitle)
.replace('{{image}}', feedItem.image || '');
const browser = await puppeteer.launch({ headers: 'new' });
const browser = await puppeteer.launch({
headers: 'new',
args: ['--no-sandbox', '--disable-setuid-sandbox'],
});
const page = await browser.newPage();
await page.setContent(html, { waitUntil: 'networkidle0' });
await page.setViewport({ width: 800, height: 600 });