Open MonsterPi13 opened 1 year ago
我也遇到了,
具体 为什么 会 闪退, 也不知道,
逐行 注释 , 发现是 code-decoder
中BarcodeDetectorDelegate
的问题
所以
function Html5QrcodeShim(requestedFormats, useBarCodeDetectorIfSupported, verbose, logger) {
this.EXECUTIONS_TO_REPORT_PERFORMANCE = 100;
this.executions = 0;
this.executionResults = [];
this.wasPrimaryDecoderUsedInLastDecode = false;
this.verbose = verbose;
// 移除其他, 只有 zxing
this.primaryDecoder = new ZXingHtml5QrcodeDecoder(requestedFormats, verbose, logger);
}
小米可以用了
Description
When using the HTML5 QR code library on Xiaomi browser, the browser crashes and closes unexpectedly. This issue occurs on Android 12 with Xiaomi MIUI browser version 17.4.240216. The user agent string is:
Mozilla/5.0 (Linux: U: Android 12: zh-cn: 22011211C Build/SP1A.210812.016) AppleWebKit/537.36(KHTMLlike Gecko) Version/4.0 Chrome/100.0.4896127 Mobile Safari/537.36 XiaoMi/MiuiBrowser/17.4.240216 swan-mibrowser
On another Xiaomi phone, the browser launches the built-in QR code scanner. The user agent string is:
Mozilla/5.0 (Linux: U: Android 12: zh-cn: M2102J2SCBuild/SKQ1.211006.001) AppleWebKit/537.36(KHTML. like Gecko) Version/4.0 Chrome/100.0.4896.127 Mobile Safari/537.36XiaoMi/MiuiBrowser/17.4.240216 swan-mibrowser
Steps to reproduce
Expected behavior
The HTML5 QR code library should be able to scan QR codes without causing the Xiaomi browser to crash.
Actual behavior
The Xiaomi browser crashes and closes unexpectedly when using the HTML5 QR code library.
Additional information
Xiaomi MIUI browser version: 17.4.240216 Android version: 12
Is there a way to avoid this from happening?