-
Notifications
You must be signed in to change notification settings - Fork 1
Installation
At first prepare required environment, Node.js LTS.
On Linux (I'm using Ubuntu and Debian), n
seems the easiest way like:
$ sudo apt install nodejs npm
$ sudo npm install -g n
$ sudo n lts
$ sudo apt remove nodejs npm
$ sudo ln -s /usr/local/bin/node /usr/bin/node
On Windows, you just need to install the version from the installer.
Next, clone this modified version, then build it. On Linux:
$ cd /tmp
$ git clone https://github.com/piroor/web-ext.git
$ cd web-ext
$ git checkout for-dogfooding
$ npm install --save-dev .
$ npm run build
$ sudo npm install -g .
On Windows:
> cd %temp%
> git clone https://github.com/piroor/web-ext.git
> cd web-ext
> git checkout for-dogfooding
> npm install --save-dev .
> npm run build
> npm install -g .
And you need to apply a patch for firefox-client/lib/client.js
to use existing profile with many tabs (see also an issue I filed at firefox-client and web-ext). For example, on Ubuntu:
$ find /usr/local/lib/node_modules -path '*/firefox-client/lib/client.js' |
while read client_js
do
if ! grep tabListChanged $client_js
then sudo sed -r -i -e 's/(var unsolicitedEvents = \{)/\1"tabListChanged":"tabListChanged","tabDetached":"tabDetached","forwardingCancelled":"forwardingCancelled",/' $client_js
fi
done
On Windows you'll need to update two files %AppData%\npm\node_modules\web-ext\node_modules\firefox-client\lib\client.js
and %AppData%\npm\node_modules\web-ext\node_modules\node-firefox-connect\node_modules\firefox-client\lib\client.js
.
Now you can run Firefox with multiple addons from their source, with static profile.
$ web-ext run --firefox=/full/path/to/firefox \
--firefox-profile=/full/path/to/your/profile \
--keep-profile-changes-completely \
--allow-remote \
--source-dir=/full/path/to/addon1,/full/path/to/addon2,/full/path/to/addon3
Note that you need to specify all paths as full paths.
For example, on a Windows PC I'm using two batch files, start-firefox-release.bat
:
@echo off
set FIREFOX=C:\Program Files\Mozilla Firefox\firefox.exe
set PROFILE=C:\Users\(username)\AppData\Roaming\Mozilla\Firefox\Profiles\(random).default
set BASE=C:\Users\(username)\codes
set ADDONS=%BASE%\treestyletab\webextensions,%BASE%\multipletab\webextensions,%BASE%\aggregate-tabs-to-main-window,%BASE%\copy-selected-tabs-to-clipboard,%BASE%\save-selected-tabs-to-files,%BASE%\popupalt,%BASE%\textlink\webextensions,%BASE%\secondsearch\webextensions
web-ext run --allow-remote --firefox="%FIREFOX%" --firefox-profile="%PROFILE%" --keep-profile-changes-completely --source-dir="%ADDONS%"
and start-firefox-nightly.bat
:
@echo off
set FIREFOX=C:\Program Files\Firefox Nightly\firefox.exe
set PROFILE=C:\Users\(username)\AppData\Roaming\Mozilla\Firefox\Profiles\(random).nightly
set BASE=C:\Users\(username)\codes
set ADDONS=%BASE%\treestyletab\webextensions,%BASE%\multipletab\webextensions,%BASE%\aggregate-tabs-to-main-window,%BASE%\copy-selected-tabs-to-clipboard,%BASE%\save-selected-tabs-to-files,%BASE%\popupalt,%BASE%\textlink\webextensions,%BASE%\secondsearch\webextensions
web-ext run --firefox="%FIREFOX%" --firefox-profile="%PROFILE%" --keep-profile-changes-completely --source-dir="%ADDONS%"
There are some differences, including --allow-remote
. I give the option only for the release version, because I'm ordinarily using it instead of Nightly.