mirror of
https://github.com/storytold/artcraft.git
synced 2026-10-31 23:47:51 +00:00
move dev browser script to main script dir
This commit is contained in:
1 parent
28ce75d8e5
commit
a2e9430b05
3 files changed
+1
-68
No files matched your search
Executable
+68
@@ -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
|
||||
|
||||
Reference in new issue
Block a user