How to Add a Non-Removable Component Extension to My Chromium Build

336 views
Skip to first unread message

Lior Solomon

unread,
Jul 26, 2023, 1:37:51 PM7/26/23
to Chromium-dev

I'm currently working on a custom Chromium build and I'm trying to include a specific extension as a component extension. My goal is to make this extension non-removable by the user. I've already successfully built and run the Chromium project following the official guide, but I need some guidance on how to proceed with adding my extension.

I've developed the extension myself, and it's not published on the Google Chrome Web Store. I understand that component extensions have more privileged API access and are loaded at startup, which aligns with what I need. However, the process of adding a new component extension seems to be complex and not straightforward.

Here are a few specific questions I have:

  1. Where should I place the source code of my extension in the Chromium source tree?

  2. Which parts of the Chromium source code do I need to modify in order to load my extension at startup?

  3. How can I ensure that my extension is non-removable by the user? I want the user to be able to enable and disable the extension, but not remove it completely.

  4. Are there any specific considerations or potential issues I should be aware of when adding my extension as a component extension?

I would greatly appreciate any guidance or resources that could help me with this process. Thank you for your time and assistance.

Best regards, Lior

guest271314

unread,
Jul 27, 2023, 11:29:10 AM7/27/23
to Chromium-dev, Lior Solomon
I supposed you can look into how Chrome implemented the Web Store extension. 
Why do you want to prevent the user from removing the extension?

From chrome://extension-internals

{ "creation_flags": [ "REQUIRE_KEY" ], "disable_reasons": [ ], "event_listeners": { "count": 0, "listeners": [ ] }, "id": "ahfgeienlihckogmohjhadlkjgocpleb", "keepalive": { "activites": [ ], "count": -1 }, "location": "COMPONENT", "manifest_version": 1, "name": "Web Store", "path": "/home/user/chrome-linux/resources/web_store", "permissions": { "active": { "api": [ "management", "system.display", "system.storage", "webstorePrivate", "system.cpu", "system.memory", "system.network" ], "explicit_hosts": [ ], "manifest": [ ], "scriptable_hosts": [ ] }, "optional": { "api": [ ], "explicit_hosts": [ ], "manifest": [ ], "scriptable_hosts": [ ] }, "tab_specific": { }, "withheld": { "api": [ ], "explicit_hosts": [ ], "manifest": [ ], "scriptable_hosts": [ ] } }, "type": "TYPE_HOSTED_APP", "version": "0.2" }


Reply all
Reply to author
Forward
0 new messages