commit fea71d47364d6e310a4315e22ea97faaa9984a9e Author: fliegerjohn Date: Mon Dec 18 22:19:26 2023 +0100 Initial commit with first version. diff --git a/README.md b/README.md new file mode 100644 index 0000000..ccbbae4 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +### Build kinda webapp with Firefox + +Firefox [removed](https://bugzilla.mozilla.org/show_bug.cgi?id=1682593) the SSB feature, so we're not able to add a webapp in this way. +I took the script from [here](https://wiki.postmarketos.org/wiki/Firefox) and modified it a little bit. +The ssb part is removed and I added the part below, so we hide the tabs toolbar and navbar. +There is also the option of starting the session in kioskmode, but I wasn't able to copy and paste there. That's why I went this way. +For now you're able to browse trough the internet with one tab. I didn't managed it to block all domains except the given one. +If you got any idea how to do that, let me know! + +To add a webapp with launcher on your homescreen run it like this: +```./add-webapp.sh "Hydrogen" "https://hydrogen.datenkastl.de"``` + +After that you have a new launcher on your homescreen from where you can open the given website inside a new profile. +Have fun! diff --git a/add-webapp.sh b/add-webapp.sh new file mode 100755 index 0000000..d43cc1e --- /dev/null +++ b/add-webapp.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +# Create firefox profile +set -e +name=$1 +url=$2 +# Ugly, copy-pasted from SO +simple_name=$(echo "$name" | awk '{print tolower($0)}' | sed 's/ //g') +echo "Creating webapp $name, using $url." + +firefox-esr -CreateProfile $simple_name + +# Create desktop entry +cat >~/.local/share/applications/$simple_name.desktop <$profile_dir/chrome/userChrome.css < #nav-bar, +#navigator-toolbox:hover > #nav-bar +{ + margin-top: 0; + margin-bottom: var(--navbar-margin); + z-index: 100; + opacity: 1; +} + +/* Hide tabs toolbar on bottom*/ +#TabsToolbar { + visibility: collapse !important; +} + +/* Hide navbar on bottom*/ +#nav-bar { + /* customize this value. */ + --navbar-margin: -30px; + + margin-top: 0; + margin-bottom: var(--navbar-margin); + z-index: -100; + transition: all 0.3s ease !important; + opacity: 0; +} + +#navigator-toolbox:focus-within > #nav-bar, +#navigator-toolbox:hover > #nav-bar +{ + margin-top: var(--navbar-margin); + margin-bottom: 0; + z-index: 100; + opacity: 1; +} + +EOL