Skip to content

Commit

Permalink
Fix Headless Chromium Mode
Browse files Browse the repository at this point in the history
- Adding `--headless=new`
- Removing forced infinite wait (If user need it he can use webui_set_timeout(0))
  • Loading branch information
hassandraga committed Sep 22, 2023
1 parent e06d972 commit edc8617
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/webui.c
Original file line number Diff line number Diff line change
Expand Up @@ -3601,7 +3601,7 @@ static int _webui_get_browser_args(_webui_window_t* win, size_t browser, char *b
c += sprintf(buffer + c, " %s", "--chrome-frame --kiosk");
// Hide Mode
if (win->hide)
c += sprintf(buffer + c, " %s", "--headless");
c += sprintf(buffer + c, " %s", "--headless --headless=new");
// Window Size
if (win->size_set)
c += sprintf(buffer + c, " --window-size=%u,%u", win->width, win->height);
Expand Down Expand Up @@ -5511,7 +5511,7 @@ static WEBUI_SERVER_START
// Mutex
_webui_mutex_unlock(&_webui_core.mutex_server_start);

if(_webui_core.startup_timeout > 0 && !win->hide) {
if(_webui_core.startup_timeout > 0) {

#ifdef WEBUI_LOG
printf("[Core]\t\t[Thread] _webui_server_start([%zu]) -> Listening Success\n", win->window_number);
Expand Down Expand Up @@ -5646,7 +5646,7 @@ static WEBUI_SERVER_START
// Let's check the flag again, there is a change that
// the flag has ben changed during the first loop for
// example when set_timeout() get called later
if(_webui_core.startup_timeout == 0 || win->hide) {
if(_webui_core.startup_timeout == 0) {

#ifdef WEBUI_LOG
printf("[Core]\t\t[Thread] _webui_server_start([%zu]) -> Listening success\n", win->window_number);
Expand Down

0 comments on commit edc8617

Please sign in to comment.