Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExtensionInstallSources in Chrome extensions for Enterprise policy

We have google chrome extension that needs to be used inside our organization. We have domains there.

Based on enterprise options the easiest approach for us is to host it on some internal web server, and then add address of that internal site as ExtensionInstallSources option to users PC via Group policies, but this does't work for me.

I've tried both registry and local Group Policy changes by adding Google Chrome adm\admx files.

Here is my registry change:

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallSources]
"1"="http://localhost/*"

When i'm checking chrome://policy - it displays that it loaded this settings. But when i open http://localhost/myextension.crx - Chrome still displays an error that extension can't be installed from there...

I'm using 47.0.2526.106 m (64-bit) under Windows 8.1 Enterprise (x64) What i'm doing wrong here?

I have more complicated option to download chrome source\pdbs, and then try to debug it to get understanding why it's not working but it may take a lot of time, as Chrome can compile for a couple of hours on Windows at first build....

like image 270
Sergey Litvinov Avatar asked Dec 21 '15 15:12

Sergey Litvinov


1 Answers

So apparently this registry change just wasn't enough. After debugging chrome source i found why it doesn't work for me. I missed:

  1. The referer MUST be present and it also should be whitelisted. So if i open url for my extension by direct link, then as referer is missing - it won't install it. (Oh Chrome, at least you could say with message about it...). If i have web page that has link to that extension, and it's also whitelisted, then it will work fine.

  2. Second missed point was that extension id MUST be present in ExtensionInstallWhitelist, otherwise Chrome will install it and with 2-3 seconds delay will disable it. But if you have listed it under ExtensionInstallWhitelist, then it will be fine.

So my final registry change for localhost is:

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome]

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallSources] "1"="http://localhost/*"

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallWhitelist] "1"="fhojekmcngnmkdbcoegjdlojgfngkpak"

I found it after long debugging in ExtensionManagement class - https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/extensions/extension_management.cc&q=ExtensionManagement::IsOffstoreInstallAllowed&sq=package:chromium&type=cs&l=148

like image 139
Sergey Litvinov Avatar answered Oct 13 '22 12:10

Sergey Litvinov