#!/bin/bash

BIN=/usr/bin/google-chrome

wayland_args=()
if [[ "${PIXELFLUX_WAYLAND:-false}" == "true" ]]; then
  wayland_args=(--ozone-platform=wayland)
fi

exec "${BIN}" \
  "${wayland_args[@]}" \
  --no-first-run \
  --no-sandbox \
  --password-store=basic \
  --simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT' \
  --start-maximized \
  --test-type \
  --remote-debugging-address=0.0.0.0 \
  --remote-debugging-port="${BROWSER_DEBUG_PORT:-9222}" \
  --user-data-dir="${BROWSER_USER_DATA_DIR:-$HOME/.config/google-chrome}" \
  "$@"
