Skip to content

Commit

Permalink
headless-browser: Call platform_init() for path of resources folder
Browse files Browse the repository at this point in the history
For `AK_OS_SERENITY`, the root path of the resources folder is "/res";
but otherwise it should be the `s_serenity_resource_root` variable set
in `platform_init()`.

However, a path provided on the command line, will override the default
path in both of those cases.

This change also makes sure that `RequestServer` can find the
certificates file `serenity/Build/lagom/share/Lagom/ladybird/cacert.pem`
  • Loading branch information
ronak69 authored and awesomekling committed Apr 24, 2024
1 parent 49e0950 commit b25d220
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Userland/Utilities/headless-browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
ByteString test_glob;
Vector<ByteString> certificates;

#if !defined(AK_OS_SERENITY)
platform_init();
resources_folder = s_serenity_resource_root;
#endif

Core::ArgsParser args_parser;
args_parser.set_general_help("This utility runs the Browser in headless mode.");
args_parser.add_option(screenshot_timeout, "Take a screenshot after [n] seconds (default: 1)", "screenshot", 's', "n");
Expand Down

0 comments on commit b25d220

Please sign in to comment.