
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
in-sight-detector
Advanced tools
试试 in-sight-detector.js 呗,用来动态检测某些 DOM 元素是否处于浏览器窗口内。
可以用来:
github 只是用来存放源码,如果想要获取生产环境所需的代码,可以通过以下两种形式:
npm install in-sight-detector
git clone https://github.com/dblate/in-sight-detector.git
cd in-sight-detector
npm install
grunt
grunt 执行完后在 dist 目录下有编译完成的代码
import InSightDetector from 'in-sight-detector'
const detector = new InSightDetector();
const testEl = document.getElementById('test-el');
detector.addListener(testEl, () => {
// testEl 出现在视图中时触发
console.log('TestEl has shown');
// 有时你需要装完哔就跑
detector.removeListener(testEl);
});
// 同时为多个元素绑定事件
detector.addListener([el0, el1, el2], () => {
console.log('Bind multiple elements at the same time');
});
// 同时为多个元素取消事件
detector.removeListener([el0, el1, el2]);
// 移除所有元素及其事件
detector.removeAllListener();
使用了 addEventListener 和 requestAnimationFrame,pc 端不兼容 IE,移动端没问题
一个页面可能会被分为多个模块,如果用 Class 创建 detector 实例,则每个 detector 的数据是独立的。反之,数据是公共的,容易误操作别人的数据
整个事件是在浏览器滚动时执行的,浏览器花了很多精力去解决滚动时的性能问题,若是因为你的一两行代码搞得页面滑动时卡顿,会有点不划算(当然一般不会这样,除非你有很多回调,而且做很多丧心病狂的操作)。
in-sight-detector.js 中通过一些手段尽量保证性能:
但决定因素还是在使用者身上,建议:
FAQs
DOM in sight detector
We found that in-sight-detector 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.

Research
A malicious package uses a QR code as steganography in an innovative technique.

Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.