Ubuntu – How to install google chrome extensions though Terminal

command lineextensiongoogle-chrome

I want to install chrome extensions in chrome browser through Terminal instead of doing in GUI.
Is there any way to install the extensions from Terminal?

Best Answer

Here is the script, you gonna need extension ids, they can be found in the address bar when you go to the details of the extension on the market or at chrome://extensions. The script will also install chrome if it is not installed, remove the middle part if that's not needed.

  1. Save this script to the install-chrome.sh file:

    install_chrome_extension () {
      mkdir -p "$preferences_dir_path"
      echo "{" > "$pref_file_path"
      echo "  \"external_update_url\": \"$upd_url\"" >> "$pref_file_path"
      echo "}" >> "$pref_file_path"
      echo Added \""$pref_file_path"\" ["$2"]
    if ! which "google-chrome" ; then
      wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub \
      | sudo apt-key add -
      echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' \
      | sudo tee /etc/apt/sources.list.d/google-chrome.list
      sudo apt-get update
      sudo apt install google-chrome-stable
      echo Chrome already installed
    install_chrome_extension "cfhdojbkjhnklbpkdaibdccddilifddb" "adblock plus"
    install_chrome_extension "fmkadmapgofadopljbjfkapdkoienihi" "react dev tools"
    install_chrome_extension "anmidgajdonkgmmilbccfefkfieajakd" "save pinned tabs"
    install_chrome_extension "dbepggeogbaibhgnhhndojpepiihcmeb" "vimium"
  2. Run

    sudo bash install-chrome.sh
  3. Restart chrome.

More scripts at https://github.com/grabantot/scripts

Related Question