dtptw6
dtptw6

Reputation: 53

Chrome adding extension with modified .crx file

I am trying to add an extension(uBlock) with some modified preferences for a packaged install. I am able to have chrome call the extension through the external_extensions.json

Location (%PROGRAMFILES(x86)\Google\Chrome\Application\43.0.2357.132\default_apps\external_extensions.json )

with the code

"epcnnfbjfcgphgdmggkamkmgojdagdnn" : {
  "external_crx": "extension_0_9_5_0.crx",
  "external_version": "0.9.5.0"
}

Chrome loads the extension but from what I can see it is calling it form the web store so the settings are at a default. I believe that it is not calling this file because I have modified the .crx file and I would be getting errors(displayed below) when I do drag and drop extension into chrome://extensions. However I do not get this error if I do not modified the .crx and use it's default settings.

CRX_SIGNATURE_VERIFICATION_FAILED or CRX_MAGIC_NUMBER_INVALID

I was wondering is there a way to correctly modify .crx file so that Chrome will accept it or is there a better method to install a custom extension?

Side note: I have tried the method of adding an extension by Windows Registry but I still have the same problem with it pulling it from a web store but this method will start the extension disabled. I would prefer this method if I can get the extension to start enabled and contain the settings I want.

Side note 2: The reason I am doing it this way and not modifying the extension through APPDATA\ is because this is a remote install, so I cannot have chrome run for the first time and create a "profile" inside app data and the extensions won't exist yet.

Upvotes: 0

Views: 1803

Answers (1)

mohammad asiyabanii
mohammad asiyabanii

Reputation: 43

you can add json file to /opt/google/chrome/extensions and named that json file your extension id like this: djflhoibgkdhkhhcedjiklpkjnoahfmg.json in json file you nid to add extension crx source & extension version like this:

{
"external_crx": "/path/to_crx/extension_1_1_0_0.crx",
"external_version": "1.1.0"
}

when chrome is lunch extension automatically added to chrome

Upvotes: 1

Related Questions