我可以从注册表本地设置扩展策略吗? [英] Can I set extension policies locally from the registry?

查看:34
本文介绍了我可以从注册表本地设置扩展策略吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Chrome扩展程序,我添加了managed_schema来定义属性(SomeSetting),因此可以通过策略进行设置.

I have a Chrome Extension and I added a managed_schema to define a property (SomeSetting) so I can set it via a policy.

manifest.json:
"storage": { "managed_schema": "schema.json" }

schema.json:
"properties": { "SomeSetting": { "type": "string" } }

我可以在chrome://policy/中看到SomeSetting,但是我不知道如何设置该值.显然,我可以在HKLM \ SOFTWARE \ Policies \ Google \ Chrome \ 3rdparty \ extensions ...上执行此操作,但是我尝试过,但从未在chrome://policy/中显示.

I can see SomeSetting in chrome://policy/ but I have no idea how to set the value. Apparently I can do this at HKLM\SOFTWARE\Policies\Google\Chrome\3rdparty\extensions... but I tried and it never is shown as set in chrome://policy/.

有人知道这是否可行吗?一定是HKCU吗?还是我需要Active Directory,因为不支持通过注册表在本地设置值?

Does anyone know if this is suppose to work? Does it have to be HKCU instead? Or do I need Active Directory because setting values locally via the registry is not supported?

推荐答案

我很难解决这个问题.文档并不十分清楚.

I had a hard time figuring this out. The documentation is not all that clear.

为了使您的架构正常工作,您需要为"SomeSetting"添加一个注册表项.

In order to get your schema to work you need to add a registry entry for "SomeSetting".

转到注册表中的以下项(创建必要的项):

Go to the following item in your registry (create the necessary items):

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\3rdparty\extensions\aaaaaaaaaaaaaa\policy

其中aaaaaaaaaaaaaaa是您来自chrome://extensions

where aaaaaaaaaaaaaa is your extension ID from chrome://extensions

右键单击策略"并创建一个新的字符串值:

Right-click on "policy" and create a new string value:

Name: SomeSetting
Data: "some value"

返回Chrome并重新加载chrome://policy/

Go back to Chrome and reload chrome://policy/

新政策应该出现.

在扩展程序中,您可以访问以下值:

From your extension, you can access the value like this:

chrome.storage.managed.get("SomeSetting", function(setting_val) {
   console.debug(setting_val);
});

我不确定这是否需要Active Directory才能工作.

I'm not sure if this requires Active Directory to work.

这篇关于我可以从注册表本地设置扩展策略吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆