diff --git a/packages/uni-cli-shared/src/json/app/manifest/checksystemwebview.ts b/packages/uni-cli-shared/src/json/app/manifest/checksystemwebview.ts new file mode 100644 index 0000000000000000000000000000000000000000..933a615f1deaeaa8f2ece3dbdb901f6c68593bd2 --- /dev/null +++ b/packages/uni-cli-shared/src/json/app/manifest/checksystemwebview.ts @@ -0,0 +1,8 @@ +export function initCheckSystemWebview(manifestJson: Record) { + // 检查Android系统webview版本 || 下载X5后启动 + let plusWebview = manifestJson.plus.webView + if (plusWebview) { + manifestJson.plus['uni-app'].webView = plusWebview + delete manifestJson.plus.webView + } +} diff --git a/packages/uni-cli-shared/src/json/app/manifest/index.ts b/packages/uni-cli-shared/src/json/app/manifest/index.ts index 97f3a777f6f02e4aebdb110f1e0cfccc98974996..e28b1c64745fe7a062a432d3a4252bdb0f07f991 100644 --- a/packages/uni-cli-shared/src/json/app/manifest/index.ts +++ b/packages/uni-cli-shared/src/json/app/manifest/index.ts @@ -9,6 +9,7 @@ import { initSplashscreen } from './splashscreen' import { initConfusion } from './confusion' import { initUniApp } from './uniApp' import { initLaunchwebview } from './launchwebview' +import { initCheckSystemWebview } from './checksystemwebview' import { initTabBar } from './tabBar' import { initI18n } from './i18n' @@ -33,6 +34,8 @@ export function normalizeAppManifestJson( manifestJson, pagesJson ) + // 依赖 initUniApp 先执行 + initCheckSystemWebview(manifestJson) return initI18n(manifestJson) }