Automatically install addons when creating new profile

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
brwno

Automatically install addons when creating new profile

Unread post by brwno » 2018-06-12, 13:36

I created a small script for 'dmenu' that allows me to open one of my existing profiles or a new one, if what I type does not match what is listed.

What I need is a way to automatically install addons (more specifically, 'pentadactyl', since it can install other addons by itself).

I have read about the 'palemoon' commandl-line switch '-install-global-extension' <viewtopic.php?t=8933>, but that does not seem to work. Besides, I don't know what "globally" means here, and would prefer to install addons or extensions only locally - that is, only for the chosen profile.

Here is the relevant part of my bash script:

Code: Select all

palemoon -profile "$profile" -install-global-extension "${addons['pentadactyl']}" --no-remote --pentadactyl " ++cmd 'exta ${addons['adblock']}' "
(Where "${addons['pentadactyl']}" is a variable that expands to <https://addons.palemoon.org/?component= ... 6a72eacf42>.)
Last edited by brwno on 2018-06-12, 13:37, edited 1 time in total.

Fedor2

Re: Automatically install addons when creating new profile

Unread post by Fedor2 » 2018-06-14, 18:41

Sure you can install addon with the any regular script.
There is required two actions.
1. copy xpi to the extensions folder
2. add entry to the extensions.json
3. add addon settings to the prefs.js

As for the install-global-extension there is no such thing in the palemoon version 27.9.3

User avatar
therube
Board Warrior
Board Warrior
Posts: 1650
Joined: 2018-06-08, 17:02

Re: Automatically install addons when creating new profile

Unread post by therube » 2018-06-14, 19:43

As noted, http://kb.mozillazine.org/Installing_ex ... stallation, says its been deprecated. (And then MDN also goes on to say, "restricted to only allow installing add-ons that are on local disks or mapped drives".)

Lew Rockwell Fan

Re: Automatically install addons when creating new profile

Unread post by Lew Rockwell Fan » 2018-06-16, 19:46

Haven't done it in a while, but if I remember correctly the exension FEBE will let you make a single xpi for all the extensions you have installed. Then to install it/them in a virgin installation, I believe you can open with "File, Open file" from the menu of the new installation or if PM is defaulting to the virgin profile you can right click on the xpi and open it with PM. Or, I believe you can do something like "palemoon /path/to/enormous.xpi" from a command line. If PM isn't defaulting to the virgin profile, you'll need to use an option for the profile.
Last edited by Lew Rockwell Fan on 2018-06-16, 19:47, edited 1 time in total.

brwno

Re: Automatically install addons when creating new profile

Unread post by brwno » 2018-06-19, 20:21

Thanks, Fedor2. The script now works as I modified it to do the following:

1. Create subdirectory 'extensions' in the profile directory.
2. Therein place an "extension proxy file" <https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Setting_up_extension_development_environment#Firefox_extension_proxy_file> named 'pentadactyl@addons.palemoon.org', containing the path to the previously obtained (and in my case, extracted) XPI file.
3. Start, then kill 'palemoon', in order to populate the profile directory.
4. Create, in the profile dir, the file 'user.js', to modify the value of the 'extensions.bootstrappedAddons' preference to '{\"pentadactyl@addons.palemoon.org\":{\"version\":\"1.2pre-pm-3\",\"type\":\"extension\",\"descriptor\":\"/home/bw/i/ib/var/pm/profiles/inf_pen/extensions/pentadactyl@addons.palemoon.org.xpi\",\"multiprocessCompatible\":false}}' - <https://superuser.com/questions/373276/how-to-enable-extension-when-running-firefox-for-the-first-time>.
5. Modify the file 'extensions.json' to have '"userDisabled":false' and '"active":true'. (See <superuser.com> link above.)

This is enough, though step 3 is rather ugly.
Last edited by brwno on 2018-06-19, 20:52, edited 1 time in total.

User avatar
therube
Board Warrior
Board Warrior
Posts: 1650
Joined: 2018-06-08, 17:02

Re: Automatically install addons when creating new profile

Unread post by therube » 2018-06-20, 04:13

3. Start, then kill 'palemoon', in order to populate the profile directory.
Do you necessarily need to populate the profile directory?
(And no, I haven't actually looked at your links, yet.)
Last edited by therube on 2018-06-20, 04:14, edited 1 time in total.

brwno

Re: Automatically install addons when creating new profile

Unread post by brwno » 2018-06-24, 12:28

therube, I need to populate the directory mostly because I wouldn't otherwise know how to create the file 'extensions.json'.

User avatar
therube
Board Warrior
Board Warrior
Posts: 1650
Joined: 2018-06-08, 17:02

Re: Automatically install addons when creating new profile

Unread post by therube » 2018-06-24, 13:35

But do you need to actually "populate the profile directory" or is simply knowing the path/name of the Profile folder sufficient?
Knowing the path/name, you can simply drop (copy) a user.js or (pre-created, with associated pathname, as extensions.json does contain pathnames) extensions.json into there?

If you can do that, then you don't have to actually run palemoon.exe, so then no need to kill it.
Last edited by therube on 2018-06-24, 13:35, edited 1 time in total.

Tomtiger
Hobby Astronomer
Hobby Astronomer
Posts: 26
Joined: 2016-02-15, 09:44

Re: Automatically install addons when creating new profile

Unread post by Tomtiger » 2018-06-26, 05:52

Hi,

why not create a new profile, install what you want, tar the contents of the profile directory to a file. When creating a new profile, just untar the file to the new profile directory?

Tom

Locked