简体   繁体   English

Chrome Enterprise 扩展程序在控制台中显示“不允许”

[英]Chrome Enterprise extensions displaying "Not allowed" in console

we are writing a chrome extension that uses the enterprise apis namely the following calls:我们正在编写一个使用企业 api 的 chrome 扩展,即以下调用:

let hardwareInfo = 

  await chrome.enterprise.hardwarePlatform.getHardwarePlatformInfo(); 

payload["manufacturer"] = hardwareInfo.manufacturer ?? null; 

payload["model"] = hardwareInfo.model ?? null; 



 let serialNoInfo = 

    await chrome.enterprise.deviceAttributes.getDeviceSerialNumber(); 

  payload["serial_no"] = serialNoInfo.serialNumber ?? null; 

It IS working for the following calls for network details:它适用于以下网络详细信息的调用:

chrome.enterprise.networkingAttributes.getNetworkDetails((info) => { 

  payload["mac_address"] = info.macAddress ?? null; 

We are finding that when deployed in a enterprise we are still getting "not allowed" errors in the console when trying to call those APIs.我们发现,在企业中部署时,在尝试调用这些 API 时,控制台中仍然出现“不允许”错误。

We are unable to get this data back for some reason and not sure where to go from here.由于某种原因,我们无法取回这些数据,并且不确定从这里到 go 的位置。 We are told the policies are set up correctly from Google Support on the enterprise side of things when deploying.我们被告知,在部署时,Google 支持在企业方面正确设置了这些政策。

We were able to get manufacturer and model when working locally on our macbook.在我们的 macbook 上本地工作时,我们能够获得制造商和 model。

Anyone see this or can offer some help, we are failing to see how this isn't the policies and how they are set up in the enterprise?任何人都看到这一点或可以提供一些帮助,我们没有看到这不是政策以及它们是如何在企业中设置的?

May be my answer will help you with "chrome.enterprise.hardwarePlatform".可能我的回答会帮助您使用“chrome.enterprise.hardwarePlatform”。 You have to enable "EnterpriseHardwarePlatformAPIEnabled" chrome enterprise policy ( https://chromeenterprise.google/policies/?policy=EnterpriseHardwarePlatformAPIEnabled ).您必须启用“EnterpriseHardwarePlatformAPIEnabled”chrome 企业策略( https://chromeenterprise.google/policies/?policy=EnterpriseHardwarePlatformAPIEnabled )。 Please note that in my case I didn't add Win registry key and it works ok without it.请注意,在我的情况下,我没有添加 Win 注册表项,没有它也可以正常工作。

I have to say that this is not documented here https://developer.chrome.com/docs/extensions/reference/enterprise_hardwarePlatform/ so developer has no clue why exactly this very API doesn't work (it also cannot be googled).我不得不说这里没有记录https://developer.chrome.com/docs/extensions/reference/enterprise_hardwarePlatform/所以开发人员不知道为什么这个非常 API 不起作用(它也不能用谷歌搜索)。

Also I asked the question about other APIs here: https://support.google.com/chrome/a/thread/176546468我还在这里问了有关其他 API 的问题: https://support.google.com/chrome/a/thread/176546468

Best, Nick最好的,尼克

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM