How to install an extension across multiple machines with a unique identifier.

220 views
Skip to first unread message

Fahad Jameel

unread,
Apr 30, 2024, 1:12:28 PMApr 30
to Chromium Extensions
I want my extension to have a unique value for each of my clients. Is there a way to pass a value through a config or something on the user's machine (machine name). 

Also, what would be the best approach to have them install this extension (MDM?)? 

Oliver Dunk

unread,
Apr 30, 2024, 1:16:48 PMApr 30
to Fahad Jameel, Chromium Extensions
Hi Fahad,

One option is chrome.storage.managed which allows you to read values set by policy: https://developer.chrome.com/docs/extensions/reference/manifest/storage

Could this be an option for what you're looking to do?
Oliver Dunk | DevRel, Chrome Extensions | https://developer.chrome.com/ | London, GB


On Tue, Apr 30, 2024 at 6:12 PM Fahad Jameel <fa...@priviom.io> wrote:
I want my extension to have a unique value for each of my clients. Is there a way to pass a value through a config or something on the user's machine (machine name). 

Also, what would be the best approach to have them install this extension (MDM?)? 

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/4837a8bb-e0fe-49bb-a281-0a94d570e777n%40chromium.org.

Fahad Jameel

unread,
May 2, 2024, 10:16:36 AMMay 2
to Chromium Extensions, Oliver Dunk, Chromium Extensions, Fahad Jameel
Is there better documentation on this? I cannot get it to work by following the directions in the link you provided. 

Here is what i did so far:
manifest.js:
storage: {
    managed_schema: "schema.json"
  },

schema.json
{
  "type": "object",
  "tenant": {
    "type": "string",
    "id": "my_company_name"
  }
}

in the code i tried this, but always get back an empty object.
chrome.storage.managed.get(["tenant"], result => {
  console.log("result", result);
});

Am I missing something?

Oliver Dunk

unread,
May 8, 2024, 9:38:02 AMMay 8
to Fahad Jameel, Chromium Extensions
Hi Fahad,

That looks good to me as far as setting up the basic schema.

To set a value in storage, you need to configure policy on the machine. Our docs are a bit limited here but this might help: https://www.chromium.org/administrators/configuring-policy-for-extensions/

As an alternative, are you signed in with a Google identity? If so, getting an ID using getProfileUserInfo() may be simpler.
Oliver Dunk | DevRel, Chrome Extensions | https://developer.chrome.com/ | London, GB

Reply all
Reply to author
Forward
0 new messages