User Tools

Site Tools


Misc:isolated_browser:start

In my web browser, I wanted to have isolated browsing windows (which do not share their session cookies, for example).

My usual settings are to delete all data and retain nothing from the history when closing the browser.
But the web browser's private browsing windows share their session cookies and I don't want that…
There are containers, but you have to decide which one to use each time, which is not practical.
So I quickly cobbled together a script that copies a new profile to /tmp/browser-$name/ (which is a copy of an existing profile) with a random path.
When you close this window, the temporary profile is deleted.
This allows you to have isolated windows and not clutter up disk space unnecessarily when closing the isolated window.
I also wanted to take advantage of saved passwords and bookmarks, which is why I use a reference profile.

Here are two solutions: one for LibreWolf and one for Firefox

solution for LibreWolf

#!/bin/bash
# this file is distributed under version 3 or superior from GNU Public Licence
# see https://www.gnu.org/licenses/gpl-3.0.en.html
 
 
# you need to personalise the source variable
# there is the source profile for me:
source="$HOME/.librewolf/*.pw"
 
# merci à ·☽•Nameless☆•777 · pour son idée d'utiliser mktemp
randompath=$(mktemp -d XXXXXXXXX --suffix=.browser -p /tmp)
 
cp -r ${source}/* ${randompath}/
librewolf --profile ${randompath};  rm -r ${randompath}

solution for Firefox

#!/bin/bash
# this file is distributed under version 3 or superior from GNU Public Licence
# see https://www.gnu.org/licenses/gpl-3.0.en.html
 
 
# you need to personalise the source variable
# there is the source profile for me:
source="$HOME/.mozilla/firefox/*.pw"
 
# merci à ·☽•Nameless☆•777 · pour son idée d'utiliser mktemp
randompath=$(mktemp -d XXXXXXXXX --suffix=.browser -p /tmp)
 
cp -r ${source}/* ${randompath}/
firefox --profile ${randompath};  rm -r ${randompath}
Misc/isolated_browser/start.txt · Last modified: by err404

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki