Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Google Chrome Extensions from the command line #8

Open
ishu3101 opened this issue Jun 28, 2016 · 10 comments
Open

Install Google Chrome Extensions from the command line #8

ishu3101 opened this issue Jun 28, 2016 · 10 comments

Comments

@ishu3101
Copy link

Add the ability to install, uninstall, search for Google Chrome Extensions from the command line like how you can install application on windows using chocolatey or homebrew on mac using the terminal.

@mdamien
Copy link
Owner

mdamien commented Jun 28, 2016

@ishu3101
Copy link
Author

ishu3101 commented Jun 28, 2016

I have looked at those links which either require the extension to be unpacked or makes use of the preference JSON file or windows registry and still require some form of user input. They are fairly limited and require manual setting up before hand for each extension that you would like to install.

Would love to be able to install any chrome extension that is available on the Chrome Web Store using something like this: cxpm install Adblock "Session Buddy". This would install both the Adblock and the Session Buddy extension from the Chrome Web Store without requiring any interference from the user.

@mdamien
Copy link
Owner

mdamien commented Jun 29, 2016

The only thing is that this possibility has been disabled because of malware adding their extensions.

I think it would at least require a fork of chrome to allow a new API to be created to manage the extension (I would definitely do it as a chrome extension that can manage other chrome extensions first before going all CLI)

@ishu3101
Copy link
Author

ishu3101 commented Jun 29, 2016

The command line app would be a separate app from chrome and the user would have to install the command line app first (so the possibility of malware being added are nil) and those that do install it are likely to know what they doing.

No fork of chrome is required as you would be downloading the extension and installing it by extracting the crx file into the user's chrome profile folder which is where the chrome extensions are installed.

@mdamien
Copy link
Owner

mdamien commented Jun 29, 2016

I mean, the power to install extension without an authaurization from within the chrome browser makes it possible for malware to add extensions. So it's been removed from chrome and you can't do it without an "Enterprise Policy" (if I understand correctly)

More infos: https://blog.chromium.org/2015/05/continuing-to-protect-chrome-users-from.html

@ishu3101
Copy link
Author

Since chrome extensions are just zip file which are renamed to .crx we can just extract them to install them on our device and so would work on any device irrespective of whether or not it has Enterprise Policy.

@jemacom
Copy link

jemacom commented Dec 14, 2017

I have been through this situation before. what I managed to do is changing a Chrome policy ExtensionInstallForcelist which enables installing an extension without the inline installation.
I did as follow:

  • Create directories of Chrome policies if they do not exist
$mkdir /etc/opt/chrome/policies
$mkdir /etc/opt/chrome/policies/managed
$mkdir /etc/opt/chrome/policies/recommended
  • Then make sure that the files under /managed are not writable by non-admin users
chmod -w /etc/opt/chrome/policies/managed
  • Create policy file
$touch /etc/opt/chrome/policies/managed/test_policy.json
  • Add these lines to the file to install Classic Cach killer extension for example :
{
	"ExtensionInstallForcelist": ["kkmknnnjliniefekpicbaaobdnjjikfp;https://clients2.google.com/service/update2/crx"]
}

You can of course change the app ID kkmknnnjliniefekpicbaaobdnjjikfp to match the extension you wanna add.

And then launch Chrome and consult chrome://extensions to see the added extension.

For references you can see: Chrome administrator and ExtensionInstallForcelist
Hope this help some of you guys.
Cheers!!!

@ishu3101
Copy link
Author

ishu3101 commented Jan 3, 2018

@jemacom What about if you are using Windows?

@nonetrix
Copy link

nonetrix commented Jan 17, 2022

@jemacom What about if you are using Windows?

This is a old issue but I should be the same if chrome hasn't changed any haven't tested if this even works anymore

Anyway hoping to add automatic extension installing to my Arch Linux setup script if anyone knows a better way of doing this tell me

@snowman
Copy link

snowman commented Feb 13, 2022

What if you want to install locally unpacked extensions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants