Coder Social home page Coder Social logo

Comments (3)

derFunk avatar derFunk commented on September 4, 2024

It's a Chromium Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=770769&desc=2
Here's an example how to make screenshotting long pages work: https://github.com/GoogleChrome/puppeteer/blob/230be28b067b521f0577206899db01f0ca7fc0d2/examples/screenshots-longpage.js

Maybe this can get included into your Docker image @alekzonder ?

from docker-puppeteer.

alekzonder avatar alekzonder commented on September 4, 2024

@derFunk yes, i add screenshot patch to docker image

from docker-puppeteer.

derFunk avatar derFunk commented on September 4, 2024

I created this, it should be working: https://gist.github.com/derFunk/10747ce60e965de5b771e96b7a4ba8f7

I extended the returned JSON to contain the created single image filenames with the 16k max texture size, and I also removed the need to query for a height dimension as a command line argument.

Stitching the single images together has to be done with e.g. ImageMagick: convert -append file1.png file2.png out.png, by iterating over the filenames (e.g. jq -r '.files[].filename').
It would be an optimization step to do stitching in the container already.

I had a little caveat though: Pretty regularly I encountered that the screenshot loop gets stuck, resulting in Error: Protocol error (Page.captureScreenshot): Target closed..
I didn't dig too deep into it, but found out that a page reload inside of the for loop seems to mitigate that specific error. It's a dirty hack (and commented out in my Gist), without me knowing why this helps, I just tried out several things to fix the getting-stuck problem.

I'll continue testing and can eventually provide a PR.

from docker-puppeteer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.