diff --git a/script/launch_dev_browser.sh b/script/launch_dev_browser.sh new file mode 100755 index 0000000000..6c51827b80 --- /dev/null +++ b/script/launch_dev_browser.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +declare -r entropy=$(xxd -l16 -ps /dev/urandom) + +#declare -r CHROME_DIR="${HOME}/.chromeDevTemp" +declare -r chrome_dir="/tmp/chrome/${entropy}" + +# See flags available and documentation: +# https://chromium.googlesource.com/chromium/src/+/HEAD/chrome/common/chrome_switches.cc +# https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md +# https://peter.sh/experiments/chromium-command-line-switches/ + +# NB: Creating the directory first seems to block process start. +# Perhaps this is the wrong chmod ownership flags. +#mkdir -p $CHROME_DIR + + #--auto-open-devtools-for-tabs="true" \ + #--devtools-flags="" \ + +# TODO(bt): Math to determine better window placement. + +launch_linux() { + chromium \ + --allow-running-insecure-content \ + --disable-features=ChromeLabs \ + --disable-site-isolation-trials \ + --disable-web-security \ + --ignore-certificate-errors \ + --install-autogenerated-theme="100,150,255" \ + --unsafely-treat-insecure-origin-as-secure="http://devproxy.fakeyou.com:7000" \ + --user-data-dir="${chrome_dir}" \ + --window-position=1200,300 \ + --window-size=1500,1700 \ + http://devproxy.fakeyou.com:7000 +} + +launch_mac() { + # See https://stackoverflow.com/a/58658101 + # NB: '7001' port is being chosen because something on the system is hogging port 7000. + # chrome://flags/#unsafely-treat-insecure-origin-as-secure - allow microphone recording + # otherwise getUserMedia() / navigator.mediaDevices will not function + # --guest: no Google login screen + open -na "Google Chrome" --args \ + --disable-features=ChromeLabs \ + --disable-site-isolation-trials \ + --disable-web-security \ + --ignore-certificate-errors \ + --install-autogenerated-theme="100,150,255" \ + --unsafely-treat-insecure-origin-as-secure="http://devproxy.fakeyou.com:7001" \ + --user-data-dir="${chrome_dir}" \ + --window-position=1200,300 \ + --window-size=1500,1700 \ + --guest \ + http://devproxy.fakeyou.com:7001 +} + +case $OSTYPE in + linux*) + launch_linux + ;; + darwin*) + launch_mac + ;; + *) + echo "Unknown OS" + ;; +esac + diff --git a/script/netlify_build.sh b/script/netlify_build.sh new file mode 100755 index 0000000000..fb2554fc32 --- /dev/null +++ b/script/netlify_build.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -euxo pipefail + +echo "Run build script (TODO: Make strict)" +yarn run build2 + +echo "List files after build" +find dist/