feat: use xvfb for WK on linux

This commit is contained in:
Pavel 2019-12-04 16:41:46 -08:00
parent 65a52294e2
commit f5b7f30144
2 changed files with 13 additions and 2 deletions

View file

@ -31,7 +31,18 @@ function runLinux() {
echo "Cannot find a MiniBrowser.app in neither location" 1>&2
exit 1
fi
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LD_PATH $MINIBROWSER "$@"
newargs=""
for arg in "$@"; do
if [[ "$arg" == "--headless" ]]; then
if which xvfb-run > /dev/null; then
MINIBROWSER="xvfb-run $MINIBROWSER"
fi
else
newargs="$newarg$arg"
fi
done
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LD_PATH $MINIBROWSER "$newargs"
}
SCRIPT_PATH="$(cd "$(dirname "$0")" ; pwd -P)"

View file

@ -78,7 +78,7 @@ export class Launcher {
stdio = ['ignore', 'ignore', 'ignore', 'pipe', 'pipe'];
webkitArguments.push('--inspector-pipe');
// Headless options is only implemented on Mac at the moment.
if (process.platform === 'darwin' && options.headless !== false)
if (options.headless !== false)
webkitArguments.push('--headless');
const webkitProcess = childProcess.spawn(
webkitExecutable,