
Research
Malicious NuGet Packages Typosquat Nethereum to Exfiltrate Wallet Keys
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.
intersection-observer-polyfill
Advanced tools
A polyfill of IntersectionObserver API.
Implements event based tracking of changes in elements position. Uses MutationsObserver and falls back to an infinite dirty checking cycle if the first one is not supported. Handles long running CSS transitions/animations, attributes and nodes mutations along with changes made by :hover pseudo-class (optional).
Written in ES6 and compliant with the spec and native implementation. Doesn't contain any publicly available methods or properties except for those described in spec. Size is 4kb when minified and gzipped.
Live demo (won't run in IE9).
From NPM:
npm install --save intersection-observer-polyfill
From Bower:
bower install --save intersection-observer-polyfill
Or just grab one of the pre-built versions from dist
.
Polyfill has been tested and known to work in the following browsers:
If you are using ES6 modules with bundlers like Webpack or JSPM:
import IntersectionObserver from 'intersection-observer-polyfill';
const observer = new IntersectionObserver((entries, observer) => {}, {
rootMargin: '100px 0px',
threshold: [0, 0.1, 0.2, 0.5, 1]
});
// ...
Alternatively you can take a pre-built UMD version.
With AMD:
define([
'intersection-observer-polyfill/dist/IntersectionObserver'
], function (IntersectionObserver) {
// ...
});
With CommonJS:
var IntersectionObserver = require('intersection-observer-polyfill/dist/IntersectionObserver');
As browsers' global:
<script src="intersection-observer-polyfill/dist/IntersectionObserver.js"></script>
<script>
(function () {
var observer = new IntersectionObserver(function () {});
})();
</script>
Optionally you can take a version that always exports itself globally.
With ES6 modules:
import 'intersecton-observer-polyfill/index.global';
const observer = new IntersectionObserver(() => {});
With AMD/CommonJS:
require('intersecton-observer-polyfill/dist/IntersectionObserver.global');
IntersectionObserver
class additionally implements following static accessor properties:
When DOM elements change theirs attributes like class
or style
an update cycle
will be initiated. This cycle is used to catch possible CSS transitions/animations and the idleTimeout
tells for how long we need run it if it doesn't detect any changes in elements position.
Default value is 50
milliseconds and you can increase it to match the delay of transitions, e.g. if transition starts after 500
milliseconds then you can set idleTimeout
to the corresponding value: IntersectionObserver.idleTimeout = 500;
. If you don't plan to use transitions then you can set this value to 0
. Otherwise it's safer to leave the default value, even if transition starts immediately.
By default possible changes in position of elements caused by CSS :hover
class are not tracked. You can set IntersectionObserver.trackHovers = true
if you need them to be supported.
NOTE: Changes made to these properties will affect all instances of IntersectionObserver, even those that were already created.
I'm very grateful to Philip Walton for the test suites of observe/unobserve methods that I took from his implementation.
FAQs
A polyfill of IntersectionObserver API
The npm package intersection-observer-polyfill receives a total of 9,225 weekly downloads. As such, intersection-observer-polyfill popularity was classified as popular.
We found that intersection-observer-polyfill 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
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
Product
Socket is launching experimental protection for the Hugging Face ecosystem, scanning for malware and malicious payload injections inside model files to prevent silent AI supply chain attacks.