timbru31 commented on a change in pull request #115: #113 (browser) - Properly
detect new Edge Chromium version as Edge instead of Chrome
URL:
https://github.com/apache/cordova-plugin-device/pull/115#discussion_r398604584
##########
File path: src/browser/DeviceProxy.js
##########
@@ -37,8 +37,16 @@ function getBrowserInfo (getModel) {
var returnVal = '';
var offset;
- if ((offset = userAgent.indexOf('Edge')) !== -1) {
- returnVal = (getModel) ? 'Edge' : userAgent.substring(offset + 5);
+ if ((offset = userAgent.indexOf('Edg')) !== -1) {
+ if (getModel) {
+ returnVal = 'Edge';
+ } else {
+ if ((offset = userAgent.indexOf('Edge')) !== -1) {
Review comment:
This won't work, as the offset might be set to `-1` again and line 47 would
return `userAgent.substring(-1 + 4);`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]