mirror of
https://gitee.com/shuto/cordova-plugin-network-information.git
synced 2025-01-31 10:35:43 +08:00
added firefoxos network apis
This commit is contained in:
parent
f761170acf
commit
96b0c5d2f6
@ -18,6 +18,15 @@
|
||||
<clobbers target="Connection" />
|
||||
</js-module>
|
||||
|
||||
<!-- firefoxos -->
|
||||
<platform name="firefoxos">
|
||||
<config-file target="config.xml" parent="/*">
|
||||
<param name="firefox-package" value="Network" />
|
||||
</config-file>
|
||||
|
||||
<source-file src="src/firefoxos/network.js" target dir="src/firefoxos" />
|
||||
</platform>
|
||||
|
||||
<!-- android -->
|
||||
<platform name="android">
|
||||
<config-file target="res/xml/config.xml" parent="/*">
|
||||
|
29
src/firefoxos/network.js
Normal file
29
src/firefoxos/network.js
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var cordova = require('cordova');
|
||||
|
||||
module.exports = {
|
||||
getConnectionInfo: function (win, fail, args) {
|
||||
var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
|
||||
win(connection.bandwidth);
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user