#!/bin/bash
#
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

PACKAGE_NAME="BrowserBox"
PACKAGE_BASE="/var/packages/${PACKAGE_NAME}/target"
CHROME="${PACKAGE_BASE}/chrome"

export PATH="$PATH:${PACKAGE_BASE}/bin:$CHROME"
export FONTCONFIG_PATH="${PACKAGE_BASE}/etc/fonts:$FONTCONFIG_PATH"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${PACKAGE_BASE}/lib:${PACKAGE_BASE}/libs:$CHROME"

export CHROME_VERSION_EXTRA="stable"

# We don't want bug-buddy intercepting our crashes. http://crbug.com/24120
# export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME

# Sanitize std{in,out,err} because they'll be shared with untrusted child
# processes (http://crbug.com/376567).
exec < /dev/null
exec > >(exec cat)
exec 2> >(exec cat >&2)

# Note: exec -a below is a bashism.
exec -a "$0" "$CHROME/chrome" --no-sandbox --ignore-certificate-errors "$@"
