mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
Moving navigator.connection to navigator.device.connection
Android 2.2 introduces the navigation.connection interface but it does not work properly in WebView. So in order to get the proper connection information we had to implement our own connection interface which is accessible at navigator.network.connection.
This commit is contained in:
parent
6618015151
commit
2177cd0a39
@ -105,13 +105,8 @@ PhoneGap.addConstructor(function() {
|
||||
if (typeof navigator.network === "undefined") {
|
||||
navigator.network = new Network();
|
||||
}
|
||||
// No native connection object for Android 2.1 or earlier, so use PhoneGap connection
|
||||
if (typeof navigator.connection === "undefined") {
|
||||
navigator.connection = new Connection();
|
||||
if (typeof navigator.network.connection === "undefined") {
|
||||
navigator.network.connection = new Connection();
|
||||
}
|
||||
// If Android 2.2+ then fire the connection ready event
|
||||
else {
|
||||
PhoneGap.onPhoneGapConnectionReady.fire();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user