#!/bin/bash
URL="https://elita-ikbal.uingusdur.ac.id/login"
UA="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 CBTKioskClient/1.0"
PROFILE="${TMPDIR:-/tmp}/ElitaIkbalKiosk"
CHROME="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
EDGE="/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"

if [ -f "$CHROME" ]; then
    "$CHROME" --kiosk --user-agent="$UA" --user-data-dir="$PROFILE" --no-first-run --no-default-browser-check "$URL"
elif [ -f "$EDGE" ]; then
    "$EDGE" --kiosk --user-agent="$UA" --user-data-dir="$PROFILE" --no-first-run --no-default-browser-check "$URL"
else
    osascript -e 'display alert "Google Chrome atau Microsoft Edge tidak ditemukan" message "Silakan install salah satu dari https://www.google.com/chrome/ atau https://www.microsoft.com/edge"'
fi
