Some web extensions work in Chromium and Firefox therefore we install addons into "/usr/share/webext/" and activate in corresponding browsers.
Enabling extension in Chromium can be done by symlinking extension folder into "/usr/share/chromium/extensions/" and installing the following snipplet into "/etc/chromium.d":
## https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890392 export CHROMIUM_FLAGS="${CHROMIUM_FLAGS} --load-extension=$(ls -dm /usr/share/chromium/extensions/*|tr -d '\n')"
Activating (sideloading) extension in Firefox is more complicated.
We need to symlink an extension directory into
/usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}
with a name as per "applications.gecko.id" value from "manifest.json".
Important caveat is that once extension is loaded, Firefox caches it in profile folder and does not reload it again even if browser is restarted after upgrading extension package. Fortunately we can trigger extension reload by touching "/usr/share/webext/{EXTENSION}/manifest.json" from postinst.
Examples can be found in the following repository:
Links: