Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-5796

Firefox OS Network Information doesn't work

    XMLWordPrintableJSON

Details

    Description

      Issue #1:

      cordova-plugin-network-information/src/firefoxos/NetworkProxy.js:ln32
      var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection; 
      

      The line above is written inside an object declaration, which causes syntax errors.

      Issue #2

      navigator.connection exists, but connection.bandwidth and connection.metered are undefined. We should instead be checking for mozConnection.bandwidth and mozConnection.metered.

      Suggested fix:

      var connection = navigator.mozConnection || navigator.webkitConnection; 
      

      Issue #3

      cordova-plugin-network-information/src/firefoxos/NetworkProxy.js:ln60
      require("cordova/firefoxos/commandProxy").add("Network", module.exports);});
      

      should be

      require("cordova/firefoxos/commandProxy").add("NetworkStatus", module.exports);});
      

      Issue #4

      The overridden navigator.connection.type doesn't speak Cordova interface.
      I am not too familiar with Firefox OS, but just wondering if navigator.mozConnection.bandwidth is 0, it can be translated to "none" and else (if bandwidth is not 0) "unknown".

      Attachments

        Activity

          People

            rsilveira Rodrigo Silveira
            nanamkim Nam Kim
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0.5h
                0.5h
                Remaining:
                Remaining Estimate - 0.5h
                0.5h
                Logged:
                Time Spent - Not Specified
                Not Specified