mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-04 00:02:03 +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:
@@ -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();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user