fix monaco-editor.

This commit is contained in:
2023-04-03 19:14:55 +08:00
parent 9228f3d169
commit 8478c15e55
5 changed files with 20 additions and 11 deletions

View File

@@ -152,3 +152,12 @@ export function decode(bytes?: string) {
)
)
}
function getChromeVersion() {
var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)
return raw ? parseInt(raw[2], 10) : 0
}
export const isLowVersion = getChromeVersion() < 80
export const protocol = isLowVersion ? "http" : "https"