You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2020/01/02 09:40:30 UTC

[GitHub] [cordova-plugin-device] mark-veenstra opened a new pull request #115: #113 (browser) - Properly detect new Edge Chromium version as Edge instead of Chrome

mark-veenstra opened a new 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
 
 
   ### Platforms affected
   browser
   
   ### Motivation and Context
   Allows the plugin to properly detect the new Edge browser based on Chromium.
   https://github.com/apache/cordova-plugin-device/issues/113
   
   
   ### Description
   The new Chromium based Edge browser exposed the following `userAgent`:
   ```
   Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36 Edg/79.0.309.54
   ```
   This change detects the browser as Edge instead of Chrome. And pulls the correct version.
   
   ### Testing
   On Edge and on Edge Chromium based execture the plugin and get the model and version
   
   ### Checklist
   
   - [x] I've run the tests to see all new and existing tests pass
   - [ ] I added automated test coverage as appropriate for this change
   - [x] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
   - [x] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   - [ ] I've updated the documentation if necessary
   
   Closes #113 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova-plugin-device] domschmidt commented on issue #115: #113 (browser) - Properly detect new Edge Chromium version as Edge instead of Chrome

Posted by GitBox <gi...@apache.org>.
domschmidt commented on issue #115: #113 (browser) - Properly detect new Edge Chromium version as Edge instead of Chrome
URL: https://github.com/apache/cordova-plugin-device/pull/115#issuecomment-604290924
 
 
   please review & merge asap =)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova-plugin-device] timbru31 commented on a change in pull request #115: #113 (browser) - Properly detect new Edge Chromium version as Edge instead of Chrome

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[GitHub] [cordova-plugin-device] mark-veenstra commented on issue #115: #113 (browser) - Properly detect new Edge Chromium version as Edge instead of Chrome

Posted by GitBox <gi...@apache.org>.
mark-veenstra commented on issue #115: #113 (browser) - Properly detect new Edge Chromium version as Edge instead of Chrome
URL: https://github.com/apache/cordova-plugin-device/pull/115#issuecomment-581306089
 
 
   Any updates?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org