Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
weex-plugin-weex-netinfo
Advanced tools
netInfo ,用户可以用这个模块监听网络变化和获取网络状态
fetch(options, callback[options])
获取当前网络状态
options {Object}
:获取网络状态时设置的参数
url {number}
:测试地址,如:www.baidu.comcallback {function (ret)}
:执行完读取操作后的回调函数。ret {Object}
为 callback
函数的参数,有两个属性:
result {string}
:结果三种类型 success
, cancel
, error
info {string}
:网络状态:ios有四种:unknown,none,cell,wifi。startMonitor(options, callback[options])
监听网络状态,网络状态发生改变返回改变后的状态
options {Object}
:监听网络时设置的参数
url {number}
:测试地址,如:www.baidu.comcallback {function (ret)}
:网络状态发生改变后的回调函数。ret {Object}
为 callback
函数的参数,有两个属性:
result {string}
:结果三种类型 success
, cancel
, error
info {string}
:网络状态:ios有四种:unknown,none,cell,wifi。stopMonitor(options, callback[options])
关闭监听
- `options {Object}`:关闭监听返回的结果
- `url {number}`:测试地址,如:www.baidu.com
- `callback {function (ret)}`:关闭监听后的回调函数。`ret {Object}` 为 `callback` 函数的参数,有两个属性:
- `result {string}`:结果三种类型 `success`, `cancel`, `error`
- `data {string}`:设置的结果,如stop。
ios:齐山(完成),android(待完成)
<template>
<div>
<div style="flex-direction: row; justify-content: center;">
<wxc-button value="getStatus" size="small" type="primary" onclick="{{getStatus}}"></wxc-button>
<wxc-button value="startMonitor" size="small" onclick="{{startMonitor}}" type="primary" style="margin-left:20px;"></wxc-button>
<wxc-button value="stopMonitor" size="small" onclick="{{stopMonitor}}" type="primary" style="margin-left:20px;"></wxc-button>
</div>
<text style="font-size:100px;">Hello World.</text>
<textarea rows=10 style="background-color:#000;height:159;width:645;border:none;font-size:24;line-height:40;color:white;padding-left: -8px;"
value={{info}}>
</textarea>
</div>
</template>
<script>
require('weex-components');
var netInfo = require('@weex-module/netInfo');
module.exports = {
data: {
info: '',
},
methods: {
getStatus:function() {
var me = this;
netInfo.fetch({url:'www.baidu.com'},function(ret){
me.info = JSON.stringify(ret)
});
},
startMonitor:function() {
var me = this;
netInfo.startMonitor({url:'www.baidu.com'},function(ret){
me.info = JSON.stringify(ret)
});
},
stopMonitor: function() {
var me = this;
netInfo.stopMonitor(function(ret){
me.info = JSON.stringify(ret)
});
},
}
};
</script>
FAQs
Unknown package
The npm package weex-plugin-weex-netinfo receives a total of 6 weekly downloads. As such, weex-plugin-weex-netinfo popularity was classified as not popular.
We found that weex-plugin-weex-netinfo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.