Reputation: 2217
I am trying to configure an extension using the method described at Manifest for storage areas
. I'm pretty sure I have everything set up correctly, but I am not seeing the policy value in chrome://policy
(it is shown as Not set
) and, obviously, there is no policy seen from
chrome.storage.managed.get(null,(d)=>{console.log(d)});
I've checked my schema and the config file I uploaded in the Admin Panel at https://www.jsonschemavalidator.net and it seems to match. It's very simple, schema.json
is
{
"type" : "object",
"properties" : {
"PolicyTest" : {
"type" : "string"
}
}
}
and in the json file
{
"PolicyTest" : "test"
}
Before I spend a bunch of time debugging this, I thought I would quickly ask- could this be because the extension that I am configuring this for is not hosted on the Chrome Web Store? It's hosted myself using the method described at Autoupdating.
Other than that, I'm not really sure why this isn't working- the device running Chrome is Linux, although I have also checked on a managed Chromebook, and I've checked things like making sure I've selected the right OU, refreshing the policy, and so on.
Upvotes: 2
Views: 1216
Reputation: 2217
Ok, I figured it out by reference to the Chromium documentation. To answer the question in my title- yes, it works fine for extensions not hosted on the Web Store, I just had the wrong format for my options.
Basically, my json file didn't actually match the schema. For the schema I posted in my question, you actually need this :
{
"PolicyTest" : {
"Value" : "test"
}
}
Basically, your properties need to be an object with a Value
field. The core sentence that I missed is : The txt file should contain a valid JSON object, mapping a policy name to an object describing the policy.
Mea cupla, I should have read the documentation more carefully. It's quite frustrating that the official Chrome extension developer documentation doesn't have a simple example of a schema and a matching config file, since there is no UI feedback if your format is wrong.
I note also there was some plan to publish a tool to build a template from a schema. I guess that never happened, it would be useful too.
Upvotes: 8