[FIX] barcodes: Android Odoo app webview not detected as chrome
Before this commit, it wasn't possible to use a barcode scanner with the Odoo mobile app. However it works fine for mobile Chrome browsers. We now know that 'keypress' event doesn't work as expected in Chrome for mobile. See @3a74afd21 It's why 'keydown' detection has been implemented. We also want to use this detection in our Android app. Unfortunately, 'window.chrome' doesn't seem to exist anymore in the Android webview. In this commit, we change the way Chrome is detected.
This commit is contained in:
@@ -53,7 +53,7 @@ var BarcodeEvents = core.Class.extend(mixins.PropertiesMixin, {
|
||||
navigator.userAgent.match(/iPod/i) ||
|
||||
navigator.userAgent.match(/BlackBerry/i) ||
|
||||
navigator.userAgent.match(/Windows Phone/i);
|
||||
this.isChromeMobile = isMobile && window.chrome;
|
||||
this.isChromeMobile = isMobile && navigator.userAgent.match(/Chrome/i);
|
||||
|
||||
// Creates an input who will receive the barcode scanner value.
|
||||
if (this.isChromeMobile) {
|
||||
|
||||
Reference in New Issue
Block a user