3

Is it possible to install AdBlock Plus, uBlock or something equivalent via terminal?

I am using Ubuntu 18.10 and want to install adblocking extension for Firefox 64. I could easily do that by launching Firefox and a few mouse clicks, but I need to repeat this operation on quite many computers and am seeking a way to automate it.

Copper
  • 51
  • 8
  • Nope, the indicated solution in the link does not help. The extension has not been installed after running firefox in silent mode. – Copper Dec 20 '18 at 17:28
  • Did you try what was proposed in the question (which seems to be wrong) or what the answers suggest? Can you please [edit] your question to include what you tried and how it failed? – Byte Commander Dec 20 '18 at 18:00
  • (for reference, the linked question was https://askubuntu.com/questions/73474/how-to-install-firefox-addon-from-command-line-in-scripts) – Byte Commander Dec 20 '18 at 18:06
  • Quick search: * https://askubuntu.com/questions/73474/how-to-install-firefox-addon-from-command-line-in-scripts * https://stackoverflow.com/questions/37728865/install-webextensions-on-firefox-from-the-command-line Cheers, Paweł. – felixd Dec 20 '18 at 18:10
  • @ByteCommander: I downloaded the extension xpi by wget and called firefox. In the silent mode (firefox -silent -install-global-extension addon-1865-latest.xpi), simply nothing happens. Without -silent, firefox pops up a window asking to click to give permission. – Copper Dec 20 '18 at 20:05
  • As far as i know global-extensions is no longer supported – Kuribo Kutsu Dec 22 '18 at 14:52
  • I did not (yet) succesfully implement any of the described solutions in the answers linked by @felixd, the closest I got so far is: firefox addon-1865-latest.xpi which still requires a manual enter in Firefox and alt+tab to return to terminal, which is not how one would want to automate it. – a.t. Nov 26 '20 at 16:34

1 Answers1

0

Why don't you try hblock? It's a sweet ad blocker with install via terminal and auto daily update.

Run the following command:

curl -o '/tmp/hblock.#1' 'https://raw.githubusercontent.com/hectorm/hblock/v3.2.0/resources/systemd/hblock.{service,timer}' \
  && echo '08b736382cb9dfd39df1207a3e90b068f5325a41dc8254d83fde5d4540ba8b5b  /tmp/hblock.service' | shasum -c \
  && echo '87a7ba5067d4c565aca96659b0dce230471a6ba35fbce1d3e9d02b264da4dc38  /tmp/hblock.timer' | shasum -c \
  && sudo mv /tmp/hblock.{service,timer} /etc/systemd/system/ \
  && sudo chown 0:0 /etc/systemd/system/hblock.{service,timer} \
  && sudo chmod 644 /etc/systemd/system/hblock.{service,timer} \
  && sudo systemctl daemon-reload \
  && sudo systemctl enable hblock.timer \
  && sudo systemctl start hblock.timer

More information here: https://github.com/hectorm/hblock/tree/master/resources/systemd

Artur Meinild
  • 26,018