Skip to content

supportScroll for headless navigator #979

Open
@TunaFFish

Description

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!

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions