Is this possible? Ideally, I'm trying to make script which will take files (my extension backup files) and replace or install them into other user's computer, with all settings saved. Is this possible. It's ok even if I have to replace whole Mozilla Firefox directory, but it would be better to install only extension with all settings saved. I cannot use gui, so I'm looking for terminal only. For example a bash script and some files which I can give to customers and they would easy install it. Is this possible? The extensions I'm trying to install this way on people's computer is user agent overrider.

  • Are we talking extensions or plugins? because they are very different from each other (Addon is an .xpi while plugin is an .so - shared object)
    – Yaron
    Jul 6, 2014 at 9:36
  • Extension, not plugin. Jul 6, 2014 at 9:40
  • Yeah. Did you know everything is possible to install via terminal? ;) Jul 6, 2014 at 9:52
  • Of course, the question is: How? :D Jul 6, 2014 at 10:03

2 Answers 2


download the extension

$ wget http://www.addons...../extension-name
$ firefox extension-name

example on Ubuntu-it Menu :

$ wget https://addons.cdn.mozilla.net/storage/public-staging/4684/ubuntu_it_menu-1.1.0-fx.xpi
$ firefox ubuntu_it_menu-1.1.0-fx.xpi

info : 'https://addons.mozilla.org/en-US/firefox/addon/ubuntu-it-menu/?src=search

  • Thanks! But, is it possible to just copy some files from my firefox directory, and then replace some files on other computer, so that firefox on other computer has the same extenssion with all settings saved? Or even copy he entire firefox directory? Jul 6, 2014 at 9:57
  • I tried this with cookies & it works but i don't know if that work well with extensions when i copied it i saw the extension still installed but i haven't tried them
    – hwez
    Jul 6, 2014 at 10:06
  • Ok, tell me what files to copy, and i'll try it. Thanks! Jul 6, 2014 at 10:24
  • i copied the main folder /home/username/.mozilla & you'll find a dir 'extension' "just for checking"
    – hwez
    Jul 6, 2014 at 10:26
  • My extension folder is empty :( Jul 6, 2014 at 10:28

This took me some time but here is a solution for the scripters out there. Essentially you have to place every .xpi as <addon id>.xpi into the extensions folder you wish.

EXTENSIONS_USER=`echo ~/.mozilla/firefox/*.default/extensions/`

get_addon_id_from_xpi () { #path to .xpi file
    addon_id_line=`unzip -p $1 install.rdf | egrep '<em:id>' -m 1`
    addon_id=`echo $addon_id_line | sed "s/.*>\(.*\)<.*/\1/"`
    echo "$addon_id"

get_addon_name_from_xpi () { #path to .xpi file
    addon_name_line=`unzip -p $1 install.rdf | egrep '<em:name>' -m 1`
    addon_name=`echo $addon_name_line | sed "s/.*>\(.*\)<.*/\1/"`
    echo "$addon_name"

# Installs .xpi given by relative path
# to the extensions path given
install_zipped () {
    new_filename=`get_addon_id_from_xpi $xpi`.xpi
    addon_name=`get_addon_name_from_xpi $xpi`
    if [ -f "$new_filepath" ]; then
        echo "File already exists: $new_filepath"
        echo "Skipping installation for addon $addon_name."
        cp "$xpi" "$new_filepath"

And now to install Adblock..

wget https://addons.mozilla.org/firefox/downloads/latest/1865/addon-1865-latest.xpi
install_for_user addon-1865-latest.xpi $EXTENSIONS_USER

Now if you start your firefox, you will be greeted with a question to install Adblock.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.