fix: purify minapp user agent tag (#5173)

This commit is contained in:
fullex 2025-04-22 13:04:53 +08:00 committed by kangfenmao
parent fd09edc2b9
commit eb89c6ea21

View File

@ -60,6 +60,9 @@ const WebviewContainer = memo(
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [appid, url]) }, [appid, url])
//remove the tag of CherryStudio and Electron
const userAgent = navigator.userAgent.replace(/CherryStudio\/\S+\s/, '').replace(/Electron\/\S+\s/, '')
return ( return (
<webview <webview
key={appid} key={appid}
@ -67,6 +70,7 @@ const WebviewContainer = memo(
style={WebviewStyle} style={WebviewStyle}
allowpopups={'true' as any} allowpopups={'true' as any}
partition="persist:webview" partition="persist:webview"
useragent={userAgent}
/> />
) )
} }