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)– YaronJul 6, 2014 at 9:36
-
Extension, not plugin.– Dusan MilosevicJul 6, 2014 at 9:40
-
Yeah. Did you know everything is possible to install via terminal? ;)– αғsнιηJul 6, 2014 at 9:52
-
Of course, the question is: How? :D– Dusan MilosevicJul 6, 2014 at 10:03
Add a comment
|
2 Answers
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– hwezJul 6, 2014 at 10:06
-
-
i copied the main folder /home/username/.mozilla & you'll find a dir 'extension' "just for checking"– hwezJul 6, 2014 at 10:26
-
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_SYSTEM='/usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/'
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 () {
xpi="${PWD}/${1}"
extensions_path=$2
new_filename=`get_addon_id_from_xpi $xpi`.xpi
new_filepath="${extensions_path}${new_filename}"
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."
else
cp "$xpi" "$new_filepath"
fi
}
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.