Clarifications:
- The .crx extension installation that I am inquiring about must take place in the Chromium Browser, not Google-Chrome Browser.
- The methodologies stated in the references mentioned by @pomsky to my earlier question only worked for Google-Chrome Browser. The original documentation for those methodologies is given here
- I have written a python script to implement points 2 & 6 of the "Using preference file" methodology (see below code which must be executed with administrator privilege). I confirm it installed the "GNOME Shell Integration" package in the Google Chrome browser. However, it did not work for the Chromium browser.
- I am looking for a solution for the Chromium browser.
- Originally, the system only had Chromium Browser. The Google Chrome browser was later installed to test the hypothesis that my script would work with it and not the Chromium browser. So presently my system has both browsers installed.
Code:
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
from pathlib import Path
from json import loads, dump
def installChromeExtension( extensionID):
extension = Path( '/opt/google/chrome/extensions/' )
extension.mkdir( mode=0o777, parents=True, exist_ok=True )
preferences_file = extension/str( extensionID + '.json' )
preferences_file.touch()
data = { 'external_update_url' :
'https://clients2.google.com/service/update2/crx' }
with preferences_file.open( "w" ) as file:
dump( data, file, indent=4 )
print( f'Created {preferences_file}.')
GNOME_Shell_Integration_id = 'gphhapmejobijbbhgpjhcjognlahblep'
installChromeExtension( GNOME_Shell_Integration_id )
According to Chromium's webpage on "Chrome Extension Developer FAQ for upcoming changes in May 2015 related to hosting extensions FAQ 8" : What are the supported deployment options for extensions after this change?:
For OSX and Linux, extensions can be installed via a preferences JSON file.
I am searching for a similar documentation for Chromium.
1. Background
According to Chromium documentation, there appear to be three approaches to installing .crx extensions. Namely, via Group Policy, via the Registry, or via master_preferences For Linux, the Registry method does not seem appropriate (it seems to be for Windows system). Also, it states that:
This other documentation also discussed the consideration for using Preferences over Policy methodologies and recommended to:
I have not been able to install the "GNOME Shell Integration" extension via the Preferences method. The good news is that I found out how to use the Policy method to install this extension in Chromium. I have described it below.
2. Installing Extension via Policy Method
Chromium does have Linux Quick Start writeup on the Policy method. Note:
For Chromium browser you need to replace
/etc/opt/chrome
with/etc/chromium
in their example else your extensions won't appear.You need to put your policy file in
/etc/chromium/policies/managed
else it won't work. I did try using/etc/chromium/policies/recommended
and it did not work. Putting the policy file into the managed directory also means that your extension cannot be removed by the user.Your policy file needs to use policy name ExtensionInstallForcelist.
3. Steps to install GNOME Shell Integration Extension in Chromium from Cmdline:
Run these commands in the terminal. The file
my_policy.json
can be any name you like, but it must be a.json
file.Add these lines into my_policy.json:
According to the GNOME Shell Integration Extension, "You MUST install native connector for this extension to work". A detailed list of commands to install the native connector is give here. For Ubuntu, do:
Close all Chromium browsers and start the Chromium browser afresh.