davidshimjs / qrcodejs

Cross-browser QRCode generator for javascript
MIT License
13.62k stars 4.76k forks source link

QRcode image always 'display:none' in some android high versions #219

Open Ajingjing006 opened 4 years ago

Ajingjing006 commented 4 years ago

the Regular Expression (/android ([0-9].[0-9])/i) not working for some android versions. maybe try '/android ([0-9]+(.[0-9])?)/i' ?

jb-72 commented 4 years ago

@Ajingjing006

I've just run into the same issue. This is the fix:

Replace line 597 of qrcode.js

QRCode.prototype.makeImage = function () { if (typeof this._oDrawing.makeImage == "function" && (!this._android || this._android >= 3)) { this._oDrawing.makeImage(); } };

with

QRCode.prototype.makeImage = function () { this._oDrawing.makeImage(); };

There shouldn't be any requirement to support below Android 3 anymore 👍