Automatically install addons when creating new profile

Support and discussions for the x86/x64 Linux version of Pale Moon.

Moderators: trava90, satrow

brwno
Hobby Astronomer
Hobby Astronomer
Posts: 16
Joined: Mon, 28 Jul 2014, 02:21
Location: Brazil

Automatically install addons when creating new profile

Postby brwno » Tue, 12 Jun 2018, 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' <https://forum.palemoon.org/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=download&id=pentadactyl@addons.palemoon.org&version=1.2pre-pm-3&hash=9ef3bd79903d0fc3fea33cc8434941484868a44e99534d33479ddd6a72eacf42>.)
Last edited by brwno on Tue, 12 Jun 2018, 13:37, edited 1 time in total.

User avatar
Fedor2
Lunatic
Lunatic
Posts: 488
Joined: Mon, 11 Apr 2016, 01:26

Re: Automatically install addons when creating new profile

Postby Fedor2 » Thu, 14 Jun 2018, 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
Moonbather
Moonbather
Posts: 64
Joined: Fri, 08 Jun 2018, 17:02

Re: Automatically install addons when creating new profile

Postby therube » Thu, 14 Jun 2018, 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
Moonbather
Moonbather
Posts: 64
Joined: Wed, 14 Jun 2017, 15:20

Re: Automatically install addons when creating new profile

Postby Lew Rockwell Fan » Sat, 16 Jun 2018, 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 Sat, 16 Jun 2018, 19:47, edited 1 time in total.

brwno
Hobby Astronomer
Hobby Astronomer
Posts: 16
Joined: Mon, 28 Jul 2014, 02:21
Location: Brazil

Re: Automatically install addons when creating new profile

Postby brwno » Tue, 19 Jun 2018, 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 Tue, 19 Jun 2018, 20:52, edited 1 time in total.

User avatar
therube
Moonbather
Moonbather
Posts: 64
Joined: Fri, 08 Jun 2018, 17:02

Re: Automatically install addons when creating new profile

Postby therube » Wed, 20 Jun 2018, 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 Wed, 20 Jun 2018, 04:14, edited 1 time in total.


Return to “Pale Moon for Linux”

Who is online

Users browsing this forum: No registered users and 7 guests