<web-view src="http://113.59.44.216/soft.imtt.qq.com/browser/tes/feedback.html?mkey=64ec73ce78551a24&f=0000&cip=120.85.60.209&proto=http"></web-view>
- 发布:2023-08-28 16:32
- 更新:2024-05-19 15:59
- 阅读:482
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Windows 10 专业版 22H2
HBuilderX类型: 正式
HBuilderX版本号: 3.8.12
手机系统: Android
手机系统版本号: Android 11
手机厂商: 华为
手机机型: BKL-AL20
页面类型: vue
vue版本: vue3
打包方式: 云端
项目创建方式: HBuilderX
操作步骤:
预期结果:
显示x5版本号
显示x5版本号
实际结果:
显示000000
显示000000
bug描述:
勾选X5,并生成自定义基座、或者云打包,均无法使用x5内核,已充分尝试了几十次重启,一直都是本机内核
获取的系统信息:
{
"SDKVersion": "",
"appId": "__UNI__ABF6930",
"appLanguage": "zh-Hans",
"appName": "AR",
"appVersion": "1.0.0",
"appVersionCode": 100,
"appWgtVersion": "1.0.0",
"brand": "huawei",
"browserName": "x5webview",
"browserVersion": "83.0.4103.106",
"deviceBrand": "huawei",
"deviceId": "76DC8D96988750D1159C5A3A2C9E274A",
"deviceModel": "BKL-AL20",
"deviceOrientation": "portrait",
"devicePixelRatio": 3,
"deviceType": "phone",
"language": "zh-CN",
"model": "BKL-AL20",
"oaid": "c7feff9b-ffee-5c5f-fc97-93f4edffe623",
"osAndroidAPILevel": 29,
"osLanguage": "zh-CN",
"osName": "android",
"osTheme": "light",
"osVersion": "10",
"pixelRatio": 3,
"platform": "android",
"romName": "HarmonyOS",
"romVersion": "3.0.0",
"safeArea": {
"left": 0,
"right": 360,
"top": 0,
"bottom": 652,
"width": 360,
"height": 652
},
"safeAreaInsets": {
"top": 0,
"right": 0,
"bottom": 0,
"left": 0
},
"screenHeight": 720,
"screenWidth": 360,
"statusBarHeight": 24,
"system": "Android 10",
"ua": "Mozilla/5.0 (Linux; Android 10; BKL-AL20 Build/HUAWEIBKL-AL20; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/83.0.4103.106 Mobile Safari/537.36 uni-app (Immersed/24.0)",
"uniCompileVersion": "3.8.12",
"uniPlatform": "app",
"uniRuntimeVersion": "3.8.12",
"version": "1.9.9.81924",
"windowBottom": 0,
"windowHeight": 652,
"windowTop": 0,
"windowWidth": 360,
"errMsg": "getSystemInfo:ok"
}
使用x5的文档https://x5.tencent.com/docs/questions.html提供的http://113.59.44.216/soft.imtt.qq.com/browser/tes/feedback.html?mkey=64ec73ce78551a24&f=0000&cip=120.85.60.209&proto=http 进行检测,发现一直都是使用系统的内核
manifest.json已配置:
"modules": {
"Webview-x5": {},
"VideoPlayer": {}
},
"webView": {
"x5": {
"timeOut": 3000, // 超时时间
"showTipsWithoutWifi": true, // 是否在非WiFi网络环境时,显示用户确认下载x5内核的弹窗。
"allowDownloadWithoutWiFi": true // 是否允许用户在非WiFi网络时进行x5内核的下载。(如果为true,就不会显示用户确认的弹窗。)
}
},
这个检测的网址貌似不可靠吧,用QQ浏览器打开也都是0
我下载了你的代码,按照uni-app文档的方法验证了可以加载的啊。有图一个是调试时候,显示Chrome,打包后是x5webview
onLoad() {
uni.getSystemInfo().then(i => {
let uv = i.browserName + ' ' + i.browserVersion
this.ua = uv
console.log('sysinfo', uv)
})
},
不是发哥 (作者)
显示是x5,但其实不是x5,因为官方文档 https://uniapp.dcloud.net.cn/tutorial/app-android-x5.html#x5%E5%86%85%E6%A0%B8%E7%9A%84%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9 中第9点也说了“可通过plus.navigator.getUserAgent判断UA中是否包含MQQBrowser关键字判断当前webview是否为X5渲染。 HX2.6.16+支持”,你看获取的ua,并不是x5
2023-08-28 22:09