From 0de598c517cd8f507761f4f7ac1ec9ec14bad339 Mon Sep 17 00:00:00 2001 From: HaQadosch Date: Sat, 25 Nov 2023 19:23:17 +0000 Subject: [PATCH] adding script to launch ffox --- README.org | 41 +++++++++++++++++++++++++++++++++++++++++ firefox.sh | 10 ++++++++++ 2 files changed, 51 insertions(+) create mode 100644 firefox.sh diff --git a/README.org b/README.org index fb513dd..e8fac8a 100644 --- a/README.org +++ b/README.org @@ -41,6 +41,47 @@ Recommended way is via curl, see the [[https://esbuild.github.io/getting-started curl -fsSL https://esbuild.github.io/dl/v0.19.7 | sh #+end_src +Now that you have ~esbulid~, install it in your local path if you fancy. +We can start a server from here. +#+name: start server +#+begin_src shell + esbuild --serve=8888 --servedir=. +#+end_src + +#+RESULTS: start server +: > Local: http://127.0.0.1:8888/ +: > Network: http://192.168.1.140:8888/ +: > Network: http://192.168.122.1:8888/ +: > Network: http://10.0.3.1:8888/ +: > Network: http://172.17.0.1:8888/ +** HTTPS +Local servers are considered secure by default. There is no need to +over-engineer the setup. At least at this point. +As for CORS and other security rules, we will fix them as they arise. +No need to fix a problem until it actually becomes a pbm. The solution will be +measured agains the reality of the situation. This is the sure way to avoid +scope creeps. +** Firefox +Because you don't want to share the development setup with other projects or +the usual browsing, e.g. same cookie origins, indexdb, and localstorage, ... +we can launch firefox with a dedicated profile. +Assuming we all know where our firefox is launched from. +#+name: firefox launcher +#+begin_src shell + #!/bin/bash + set -eu + + DATA_DIR="$(mktemp -d -t 'firefox_unsafe_data_dir.XXXXXXXXXX')" + /usr/local/bin/firefox/firefox-bin \ + -profile $DATA_DIR \ + -no-remote \ + -devtools \ + -url http://localhost:8888 \ + > /dev/null 2>&1 &! +#+end_src + +#+RESULTS: firefox launcher + * Footnotes [fn:1]Which causes 2 problems: diff --git a/firefox.sh b/firefox.sh new file mode 100644 index 0000000..7837992 --- /dev/null +++ b/firefox.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -eu + +DATA_DIR="$(mktemp -d -t 'firefox_unsafe_data_dir.XXXXXXXXXX')" +/usr/local/bin/firefox/firefox-bin \ + -profile $DATA_DIR \ + -no-remote \ + -devtools \ + -url http://localhost:8888 \ + > /dev/null 2>&1 &!