Even using the browser extension, it’s the chrome-gnome-shell connector that performs all the magic, and that’s a Python script you can read to see how it does it.
(But the answer is exactly as @andyholmes said, using the InstallRemoteExtension dbus call.) Selected portions of the source:
class ChromeGNOMEShell(Gio.Application):
def __init__(self, run_as_service):
Gio.Application.__init__(
self,
application_id='org.gnome.ChromeGnomeShell',
flags=Gio.ApplicationFlags.IS_SERVICE if run_as_service
else Gio.ApplicationFlags.IS_LAUNCHER | Gio.ApplicationFlags.HANDLES_OPEN
)
if not run_as_service:
self.shell_proxy = Gio.DBusProxy.new_sync(self.get_dbus_connection(),
Gio.DBusProxyFlags.NONE,
None,
'org.gnome.Shell',
'/org/gnome/Shell',
'org.gnome.Shell.Extensions',
None)
def dbus_call_response(self, method, parameters, result_property):
try:
result = self.shell_proxy.call_sync(method,
parameters,
Gio.DBusCallFlags.NONE,
-1,
None)
self.send_message({'success': True, result_property: result.unpack()[0]})
except GLib.GError as e:
self.send_error(e.message)
[...]
if request['execute'] == 'installExtension':
self.dbus_call_response(
"InstallRemoteExtension",
GLib.Variant.new_tuple(GLib.Variant.new_string(request['uuid'])),
"status"
)