#!/usr/bin/env sh
if [ ! -e /usr/lib/firefox/firefox ];then
    /usr/bin/biglinux-webapp "firelibre"
    exit
fi

FOLDER=~/.bigwebapps/netflix-webapp-biglinux-firefox
CLASS="webapp-netflix-webapp-biglinux-firefox"

if [ ! -d "$FOLDER" ];then
    mkdir -p "$FOLDER/chrome"
    cp -a /usr/share/bigbashview/bcc/apps/biglinux-webapps/profile/userChrome.css "$FOLDER/chrome"
    cp -a /usr/share/bigbashview/bcc/apps/biglinux-webapps/profile/user.js "$FOLDER"
fi

MOZ_DISABLE_GMP_SANDBOX=1 MOZ_DISABLE_CONTENT_SANDBOX=1 \
XAPP_FORCE_GTKWINDOW_ICON=/usr/share/icons/hicolor/128x128/apps/webapp-netflix.svg \
firefox --class="$CLASS" --profile "$FOLDER" --no-remote --new-instance "https://www.netflix.com/" &
