fix: purify minapp user agent tag (#5173)
This commit is contained in:
parent
fd09edc2b9
commit
eb89c6ea21
@ -60,6 +60,9 @@ const WebviewContainer = memo(
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [appid, url])
|
||||
|
||||
//remove the tag of CherryStudio and Electron
|
||||
const userAgent = navigator.userAgent.replace(/CherryStudio\/\S+\s/, '').replace(/Electron\/\S+\s/, '')
|
||||
|
||||
return (
|
||||
<webview
|
||||
key={appid}
|
||||
@ -67,6 +70,7 @@ const WebviewContainer = memo(
|
||||
style={WebviewStyle}
|
||||
allowpopups={'true' as any}
|
||||
partition="persist:webview"
|
||||
useragent={userAgent}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user