Build static .lib and/or dynamic .dll library "Headless Chrome" for Windows

367 views
Skip to first unread message

stacky Overflocky

unread,
Jan 22, 2022, 11:40:12 AM1/22/22
to headless-dev
Hello

I apologize in advance if the question seems too stupid, but let me ask:

I would like to include the "Headless Chrome" library in my C++ project in order to be able to interact with the Internet.

If I understood correctly, then here on this page: https://source.chromium.org/chromium/chromium/src /+/master:headless/

It is said that "Headless Chrome" can be connected to a C++ project:

Usage as a C++ library

Headless Chromium can be built as a library for embedding into a C++ application. This approach is otherwise similar to controlling the browser over a DevTools connection, but it provides more customization points, e.g., for networking and mojo services.

Headless Example is a small sample application which demonstrates the use of the headless C++ API. It loads a web page and outputs the resulting DOM. To run it, first initialize a headless build configuration.

And that's where the problem starts for me, I can't figure out how to build "Headless Chrome" and from which source code to build it?


I need to use the source code of "chromium": https://github.com/chromium/chromium ?

or something else ?

If possible, please tell me.


Alex Clarke

unread,
Jan 24, 2022, 2:54:44 PM1/24/22
to stacky Overflocky, headless-dev
It's been a few years since I last tried building headless chrome, but you'll need a chromium checkout (beware this is rather big). See https://www.chromium.org/developers/how-tos/get-the-code

Then you'll need the right command to build it.  I suspect this ninja command will still work:   ninja -C out/Debug headless_example
But I've not tried it in some time, so it's possible something changed that I wasn't aware of.  Either way expect the ninja command to take some time to run.

--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/53001caf-15ad-4f38-8951-1f360c2bf926n%40chromium.org.
Reply all
Reply to author
Forward
0 new messages