mirror of
https://gitee.com/shuto/cordova-plugin-network-information.git
synced 2025-01-19 14:02:50 +08:00
Fix network information type exception on fxos 2
This commit is contained in:
parent
a810b7db99
commit
ec96704786
@ -34,8 +34,16 @@ module.exports = {
|
|||||||
|
|
||||||
getConnectionInfo: function(successCallback, errorCallback) {
|
getConnectionInfo: function(successCallback, errorCallback) {
|
||||||
var connection = origConnection || navigator.mozConnection,
|
var connection = origConnection || navigator.mozConnection,
|
||||||
connectionType = Connection.UNKNOWN,
|
connectionType = Connection.UNKNOWN;
|
||||||
bandwidth = connection.bandwidth,
|
|
||||||
|
if (!connection) {
|
||||||
|
setTimeout(function() {
|
||||||
|
successCallback(connectionType);
|
||||||
|
}, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var bandwidth = connection.bandwidth,
|
||||||
metered = connection.metered,
|
metered = connection.metered,
|
||||||
type = connection.type;
|
type = connection.type;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user