如何使用Android Management API在网络视图中设置白名单
我正在使用Chrome托管配置在我的策略中将此代码设置为白名单:
I am using Chrome Managed Configurations to set a whitelist with this code in my policy:
{
"packageName": "com.android.chrome",
"managedConfiguration": {
'URLBlacklist': ['*'],
'URLWhitelist': ['chrome://*', 'google.com', 'stackoverflow.com'],
'ForceGoogleSafeSearch': True,
'NTPContentSuggestionsEnabled': False,
}
}
现在,在 Chrome企业文档中,表示可以通过com.android.browser:URLBlacklist
限制将相同的设置应用于Android Web视图,但没有说明我将其放置在策略中的位置.
Now, in the Chrome enterprise docs it says there is a way to apply the same settings to Android Web view with the com.android.browser:URLBlacklist
restriction, but it does not explain where I would put this in my policy.
以下代码不起作用:
{
"packageName": "com.android.chrome",
"managedConfiguration": {
'com.android.browser:URLBlacklist': ['reddit.com', 'youtube.com'],
'com.android.browser:URLWhitelist': ['stackoverflow.com', 'google.com']
}
}
它在电话上显示chrome://policy中的错误.
It shows an error in chrome://policy on the phone.
com.android.browser
甚至不是真正的应用程序.
com.android.browser
is not even a real app.
在哪里需要使用此com.android.browser:URLBlacklist
将限制应用于电话上的所有网络视图?
Where do I need to use this com.android.browser:URLBlacklist
to apply restrictions to all web views on the phone?
您必须分别为每个应用设置黑名单/白名单.
You have to set the blacklist/whitelist for each app individually.
例如:
{
"packageName": "com.jetblue.JetBlueAndroid",
"managedConfiguration": {
'com.android.browser:URLBlacklist': ['*'],
'com.android.browser:URLWhitelist': ['jetblue.com']
}
}
除了JetBlue.com之外,此代码还会阻止JetBlue应用程序中的所有域
This code blocks all domains within the JetBlue app besides for JetBlue.com
有些事情要注意: 1.注意不要阻止应用程序需要运行的任何域(包括登录页面等). 2.如果应用使用直接API而不是Web视图显示内容,则这些限制将不适用.
There are some things to be aware of: 1. Be careful not to block any domains the app needs to function (including login pages, etc.). 2. If an app uses a direct API to display content, not a web view, then these restrictions will not apply.