text/gemini
# Develop add-ons for the Cliqz Browser
Sooner or later, the Cliqz browser[1] will finally allow add-ons installation. As this web browser is built on top of Mozilla Firefox, you should follow the Mozilla documentation[2] to know more how to build such an add-on.
This article will only focus on testing your add-on with Cliqz. Even if current cliqz build doesn't allow add-ons installation, the underlying Mozilla platform does allow local and in-dev add-on side loading. That is to say, you don't have to wait for the add-ons enabled build of cliqz to begin to play with this browser.
The first thing to do is to install the Mozilla web-ext[3] tool. To install it, you need to have the node package manager installed on your machine. For Archlinux, you need to run `sudo pacman -S npm', while on Debian/Ubuntu you'll need to run `sudo apt-get install npm'. Then, I recommend you to locally install web-ext. Here is a common `package.json' stub you can use for your add-ons. This file has to be placed in your add-on source root folder:
```javascript
{
"name": "addon_name",
"version": "0.0.1",
"scripts": {
"dev": "web-ext run --bc --ignore-files node_modules web-ext-artifacts \"package*.json\"",
"lint": "web-ext lint --ignore-files node_modules web-ext-artifacts \"package*.json\""
},
"devDependencies": {
"web-ext": "^2.9"
}
}
```
Finally, run `npm install' to retrieve web-ext and all its dependencies.
When it's done, enter `npm run dev' to test your add-on in a clean and isolated environment. As you can see, the previous command has launched Firefox. So what's up? By default, web-ext will start your local firefox installation. But you can select any other Mozilla platform software with the `-f' switch. In our case (a Linux environment), we just have to modify the previous command this way: `npm run dev -- -f /usr/bin/cliqz' and tadaa, cliqz starts with your add-on.
=> media/Capture_du_2018-12-12_13-50-10.png media/Capture_du_2018-12-12_13-50-10.png
I let you discover all the other web-ext possibilities[4] if you don't know them already.
One problem you may encounter for now, is that cliqz hides the `about:addons' page (the page, which lists all your installed add-ons). This may prevent you to find your add-on and access its preferences. One solution may be to expose a browserAction[5] (a browser toolbar icon). Because browserActions embed a context menu item, which will open the add-on preference page, even if the add-ons list is hidden:
=> media/Capture_du_2018-12-12_13-50-49.png media/Capture_du_2018-12-12_13-50-49.png
That's all, happy coding with Cliqz add-ons :)
=> https://cliqz.com/en/ [1] Cliqz browser (HTTPS)
=> https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions [2] Mozilla documentation (HTTPS)
=> https://github.com/mozilla/web-ext [3] Mozilla web-ext (HTTPS)
=> https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Getting_started_with_web-ext [4] discover all the other web-ext possibilities (HTTPS)
=> https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browserAction [5] browserAction (HTTPS)
--
📅 mercredi 12 décembre 2018 à 13:28
📝 Étienne Pflieger with GNU/Emacs 29.4 (Org mode 9.7.11)
=> gemini://alltext.umaneti.net/gemlog/tags/bidouille.gmi 🏷️ Bidouille
=> gemini://alltext.umaneti.net/gemlog/tags/cliqz.gmi 🏷️ Cliqz
=> gemini://alltext.umaneti.net/gemlog/tags/addons.gmi 🏷️ addons
=> gemini://alltext.umaneti.net/gemlog/tags/firefox.gmi 🏷️ Firefox
=> gemini://alltext.umaneti.net/gemlog 📜 Back to gemlog
=> gemini://alltext.umaneti.net 🏡 Back to home
=> gemini://alltext.umaneti.net/fronde/README.gmi 🚀 Propelled by fronde
This content has been proxied by September (3851b).