Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
blankscreen
Advanced tools
白屏监控组件,支持多实例,默认支持全屏白屏监控,和 React 组件白屏监控。
blankscreen 内置了全屏白屏监控,引入 blankscreen 后,只需要复写 onError, onSuccess 方法即可。
import BlankScreen from 'blankscreen';
BlankScreen.onError = function(err) {
console.log('full-page blank screen', err);
};
BlankScreen.onSuccess = function(meta) {
console.log('full-page OK', meta);
};
blankscreen 还内置了 React 组件,包含待检查的组件外部即可检查内部是否处于白屏状态。
import ReactBlankScreen from 'blankscreen/lib/react';
render() {
return (
<ReactBlankScreen
rule-text={10}
onError={this.onError}
onSuccess={this.onSuccess}
autoStart
>
<div></div>
</ReactBlankScreen>
);
}
如果组件需要异步检查,不设置 autoStart 或设置为 false,然后通过 ref 主动调用 start() 方法启动检查。
import ReactBlankScreen from 'blankscreen/lib/react';
componentDidMount() {
setTimeout(() => {
this.refs.blankscreen.start();
}, 1000);
}
render() {
return (
<ReactBlankScreen
ref="blankscreen"
rule-text={10}
onError={this.onError}
onSuccess={this.onSuccess}
>
<div></div>
</ReactBlankScreen>
);
}
import BaseBlankScreen from 'blankscreen/lib/base';
const bs = new BaseBlankScreen(element, {
rule: {
text: 0,
},
onError: err => console.error(err),
onSuccess: meta => console.log(meta),
autoStart: true,
})
bs.start();
文字\元素 | 有 | 无 |
---|---|---|
有 | 黑 | 黑 |
无 | 白 | 白 |
原则上,只通过是否有指定个数的『文字』来判定是否白屏, 子元素个数多少不作为判定条件,只作为附加信息。
注:
开始检查白屏,白屏时间从此时开始计算。
停止检查。超时(6s)或离开页面时自动停止检查。
注:终止后会判定是否白屏,得到判定结果后,不可再次启动检查。
可复写的白屏处理函数。判定为白屏时会调用 onError 函数。
err:
可复写的非白屏处理函数,最终判定为非白屏,会调用 onSuccess 函数。
meta:
2018-08-01 v1.0.1
FAQs
BlankScreen
The npm package blankscreen receives a total of 0 weekly downloads. As such, blankscreen popularity was classified as not popular.
We found that blankscreen 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.