You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constfs=require('fs')constpuppeteer=require('puppeteer')// downloaded from https://github.com/gildas-lormeau/single-file-cli/blob/master/lib/single-file-bundle.js// and modified its way to export, making it a cjs moduleconst{ script }=require('./lib/single-file-bundle');(async()=>{constbrowser=awaitpuppeteer.launch({defaultViewport: {width: 940,height: 700},// in headful mode I can see all images are loaded// but still lost those images// headless: false})constpages=awaitbrowser.pages();constpage=pages[0];awaitpage.evaluateOnNewDocument(script);awaitpage.goto('https://image.baidu.com/',{waitUntil: ['networkidle0']})// tried to sleep some times here but not workingconstpageData=awaitpage.evaluate(async()=>{// I guess that some configs are needed so I tried to use the DEFAULT_CONFIG in// https://github.com/gildas-lormeau/SingleFile/blob/master/src/core/bg/config.js#L52// but not workingreturnawaitsinglefile.getPageData({})});fs.writeFileSync(`./test-${newDate().getTime()}.html`,pageData.content,{encoding: 'utf-8'})awaitbrowser.close()})()
Expected behavior
Puppeteer gets the same result as chrome extension
Screenshots
Environment
OS: mbp m1 Sonoma 14.3.1
Browser: Chrome
Version: 131.0.6778.140
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug
I was trying to use singlefile in my puppeteer code and in some sites it lost some images.
To Reproduce
This issue can be reproduced in https://image.baidu.com/
I got correct result when using chrome extension:
But with my codes:
Minimal reproducible codes:
Expected behavior
Puppeteer gets the same result as chrome extension
Screenshots
Environment
Additional context
The text was updated successfully, but these errors were encountered: