!2853 开发:浏览器版本判断

pull/2784/MERGE
林三 3 months ago committed by ChenX
parent 92e7343834
commit d335837f34

@ -135,8 +135,8 @@
"stats.js": "^0.17.0",
"swiper": "6.8.4",
"three": "npm:three-cf@0.122.6",
"swiper": "6.8.4",
"xaop": "^2.1.0"
"xaop": "^2.1.0",
"core-js": "3.37.1"
},
"resolutions": {
"acorn": "8.8.1",

@ -1,4 +1,6 @@
import { Intent } from '@blueprintjs/core';
import 'core-js/features/object/has-own';
import React from 'react';
import { Cache, Layers, Object3D } from 'three';
import { HostApplicationServices } from './ApplicationServices/HostApplicationServices';
import { ColorPalette } from './Common/ColorPalette';
@ -142,6 +144,31 @@ window.onload = function ()
return false;
}
function CheckChromeVer93(): string
{
try
{
const browser = detect();
if (browser.name === "chrome" || browser.name === "edge-chromium")
{
let ver = parseInt(browser.version.split(".")[0]);
if (browser.os === "Windows 7")
{
if (ver < 93)
return "https://dl.google.com/release2/chrome/czao2hrvpk5wgqrkz4kks5r734_109.0.5414.120/109.0.5414.120_chrome_installer.exe";
}
else if (ver < 93)
return "https://www.google.cn/chrome/";
}
return "";//其他浏览器??
}
catch (error)
{
}
return "";
}
let isWebGlSupport = isWebGLAvailable();
let isChromeVerSupport = CheckChromeVer();
if (!isWebGlSupport || !isChromeVerSupport)
@ -182,8 +209,27 @@ window.onload = function ()
else if (window.location.hostname === "localhost")
ReportErrorWrap.IsProduction = false;
else
{
ReportErrorWrap.IsProduction = true;
let linkUrl = CheckChromeVer93();
if (linkUrl)
{
let logVer = AppToaster.show({
message: <>
,,
<button onClick={() =>
{
window.open(linkUrl);
AppToaster.dismiss(logVer);
}}></button>
</>,
timeout: 30000,
}, "logVer");
}
}
Object3D.DefaultMatrixAutoUpdate = false;
Layers.prototype.test = (layers) => true;

Loading…
Cancel
Save