tencent cloud

Tencent Cloud Super App as a Service

Contrato
Contrato de segurança e processamento de dados
DocumentaçãoTencent Cloud Super App as a Service

Customizing UserAgent

Modo Foco
Tamanho da Fonte
Última atualização: 2025-07-04 17:33:28
You can override the configData method in the BaseMiniAppProxyImpl class and intercept the method implementation for configType equal to MiniConfigData.TYPE_WEBVIEW.
Example:
@Override
public MiniConfigData configData(Context context, int configType, JSONObject params) {
if(configType == MiniConfigData.TYPE_WEBVIEW) {
//webView userAgent
String ua = params.optString(MiniConfigData.WebViewConfig.WEBVIEW_CONFIG_UA);
MiniConfigData.WebViewConfig webViewConfig = new MiniConfigData.WebViewConfig();
// Set the UserAgent that developers need to add. Note: Do not set the original UserAgent value.
webViewConfig.userAgent = "key/value";

return new MiniConfigData
.Builder()
.webViewConfig(webViewConfig)
.build();
}

return new MiniConfigData
.Builder()
.build();
}





Ajuda e Suporte

Esta página foi útil?

comentários