News for hackers. Stuff that matters.
Re:Ask HN: Best things in your bash_profile/aliases? by callahad on Sunday January 13, 2019 @04:37PM (#18898865)
This is tiny, but I've gotten a surprising amount of mileage out of aliasing 'fx' to

  firefox --new-instance --profile $(mktemp -d)
which pops open a new instance of Firefox with a completely clean, temporary profile.

Super useful for testing sites or add-ons without influencing (or being influenced by) by my normal browsing profile.

Re:Ask HN: Best things in your bash_profile/aliases? by egoisticalgoat on Monday January 14, 2019 @05:17AM (#18901984)
I can't believe i never thought of using command line switches for that kind of stuff, i always just have firefox set to forget all data on close.

Not exactly a bash alias, but might be useful too: Since I often get bug reports for specific versions of firefox, i've set up a small script for downloading and starting a given firefox version: https://pastebin.com/t2PHxJqE

Re:Ask HN: Best things in your bash_profile/aliases? by kalev on Monday January 14, 2019 @06:00AM (#18902136)
What would the Google Chrome equivalent look like?
Re:Ask HN: Best things in your bash_profile/aliases? by scrollaway on Monday January 14, 2019 @07:15AM (#18902444)
chromium --user-data-dir $(mktemp -d)
Re:Ask HN: Best things in your bash_profile/aliases? by noir_lord on Monday January 14, 2019 @04:27PM (#18906673)
Aye, learnt this when I wanted selenium profiles with some Dev plugins available but not my main profile.
Re:Ask HN: Best things in your bash_profile/aliases? by Topgamer7 on Sunday January 13, 2019 @06:06PM (#18899291)
I have a similar command, except it keeps the existing addons from my main profile. Which is useful as I need a proxy for different environments for work.
Re:Ask HN: Best things in your bash_profile/aliases? by zyber on Monday January 14, 2019 @05:05AM (#18901946)
Please share how you did do that, that sounds awesome!
Re:Ask HN: Best things in your bash_profile/aliases? by Topgamer7 on Monday January 14, 2019 @04:42PM (#18906807)

    #!/bin/sh
    PROFILEDIR=`mktemp -p /tmp -d tmp-fx-profile.XXXXXX.d`
    mkdir -p $PROFILEDIR/extensions 
    cd ~/.mozilla/firefox/yvwc47i0.default/
    cp extensions/* $PROFILEDIR/extensions/
    cp addons.json extensions.json $PROFILEDIR/
    cp -R browser-extension-data $PROFILEDIR/
    cp cert_override.txt $PROFILEDIR/
    #cp prefs.js $PROFILEDIR/
    echo 'user_pref("devtools.selfxss.count", 10);' > $PROFILEDIR/prefs.js
    cd -
    firefox -profile $PROFILEDIR -no-remote -new-instance
    rm -rf $PROFILEDIR
Created this as a script somewhere in my path. You'd need to change `cd ~/.mozilla/firefox/yvwc47i0.default/` to match what yours is.
Re:Ask HN: Best things in your bash_profile/aliases? by OJFord on Monday January 14, 2019 @06:30AM (#18902247)
Not GP, but you could just do the same except after making the temp dir: copy in `profile/addons.json` and `-r profile/extension*` from your main profile. (There might be other files needed to, not tested.)
Re:Ask HN: Best things in your bash_profile/aliases? by throwaway2021 on Sunday January 13, 2019 @11:00PM (#18900534)
This is great, thanks.