Lightweight chromium just to render and take screenshots?

777 views
Skip to first unread message

Raghavendra

unread,
Apr 4, 2022, 2:12:15 PM4/4/22
to Chromium-dev

Hi,

In our app we need to take the screenshot of the webpages. We tried with the headless Chrome and Puppeteer. But they are very slow. And sometimes it takes nearly a minute to generate the screenshot for a page with approximately 20MB size(with 7-8 network requests). Also we are processing bulk requests and these requests are taking really long time.


So we are looking to do build the stripped down version of chromium which will just have enough functionality to render the page and generate the screenshots.


I understand Content module is where I need to be looking into. But I don’t know where to start.


I have followed the build steps here and pulled the code.


  1. From here how do I build only content module?
  2. If I build only the content module, can I use the chrome executable from command line to take screenshots?


Thanks

K. Moon

unread,
Apr 4, 2022, 3:09:28 PM4/4/22
to nraghav...@gmail.com, Chromium-dev
The content_shell binary is a minimal binary that only depends on the content API; I would start there. That said, I think your hypothesis is based on an incorrect assumption; just compiling in additional parts of Chrome doesn't slow anything down. You should measure the performance of your task to find the actual bottleneck.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/d37191cf-cd25-4ad7-bf99-76959de3158fn%40chromium.org.

Raghavendra

unread,
Apr 11, 2022, 4:05:11 PM4/11/22
to Chromium-dev, km...@chromium.org, Chromium-dev, Raghavendra
Thank you!

We solved our problem by locally creating the remote html file and downloading the required image files. So the Chrome doesn't have to make http requests, we just pass local file:// url and it is loading fast.

However I would like to explore the possibilities with content_shell. I've built the content shell with the command: autoninja -C out/Default content_shell. And if run the executable by calling out/Default/content_shell, the minimal browser comes up.
But the size of out/Default directory is 4.8 GB. How do I minimize this or how do I build an installable package with only required files. Any documentation or direction will be helpful. 

FYI: I'm working on UBUNTU 18.04.

Thanks!

K. Moon

unread,
Apr 12, 2022, 1:23:07 PM4/12/22
to Raghavendra, Chromium-dev
Reply all
Reply to author
Forward
0 new messages