diff options
| author | Adrien Dieudonne <adr@odoo.com> | 2018-04-30 12:30:03 +0200 |
|---|---|---|
| committer | Adrien Dieudonne <adr@odoo.com> | 2018-04-30 16:14:46 +0200 |
| commit | fa2ea4683e198fc4565f2a0d9d5071c9428132f1 (patch) | |
| tree | d2fca4f33c3dbc4ab1cab8898e55ed435df4d3ec /addons/barcodes/static | |
| parent | 9e14d93c05895fa501d9eee9d75a87f17d6f5f89 (diff) | |
[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.
Diffstat (limited to 'addons/barcodes/static')
| -rw-r--r-- | addons/barcodes/static/src/js/barcode_events.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/barcodes/static/src/js/barcode_events.js b/addons/barcodes/static/src/js/barcode_events.js index 88ed3ce814c..a2e5808f8be 100644 --- a/addons/barcodes/static/src/js/barcode_events.js +++ b/addons/barcodes/static/src/js/barcode_events.js @@ -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) { |
