Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supportScroll for headless navigator #979

Open
TunaFFish opened this issue Jan 1, 2023 · 0 comments
Open

supportScroll for headless navigator #979

TunaFFish opened this issue Jan 1, 2023 · 0 comments

Comments

@TunaFFish
Copy link

supportScroll for headless navigator

So I saved a website offline (sitesucker) and trying to convert the webpages to PDF's using the WKHTMLTOPDF library using command lines.
I found out with some JS that WKHTMLTO PDF's headless navigator support sscroll events.
Navigator: Netscape
App version: 5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) Qt/4.8.7 Safari/534.34
App codename: Mozilla
Platform: MacIntel
Scroll support: true

This of course gives me the problem of images not being loaded...

So I tried hardcoding the supportScroll in the loader function
var supportScroll = false; // ('onscroll' in window) && !(/(gle|ing)bot/.test(navigator.userAgent));

This seems to work in Firefox, the images have the classes changed to lazyautosizes and lazyloaded and the low res images are replaced.

Using the WKHTMLTOPDF's the full res images out of the viewport are NOT loaded.

Same using Safari, the images out the viewport are not replaced!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant