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.
@nisyaban/impression
Advanced tools
Impression is a gallery of easy to use scripts to have HTML DOM element 'impression' event on your web pages.
Pick one that you need, add CSS class 'impression' (overridable default) to elements you want to
track, and then add listeners for the event just as you use click
event or any other events.
To fire impression
event one time when an element becomes visible, use one of the following CDNs.
To fire impression
event one time when an element becomes visible and impressioff
event one time
when an element is no longer visible, use one of the following CDNs.
<script src='https://cdn.jsdelivr.net/npm/@setyadi/impression/dist/92+/impression.min.js'></script>
<script src='https://cdn.jsdelivr.net/npm/@setyadi/impression/dist/92+/impression+off.min.js'></script>
<script src='https://unpkg.com/@setyadi/impression/dist/92+/impression.min.js'></script>
<script src='https://unpkg.com/@setyadi/impression/dist/92+/impression+off.min.js'></script>
By default, the script would just work provided that you agree with the default values. But if you want to use something different, you can override the defaults by adding the following attributes on the script tag.
Attributes | Description | Default Value |
---|---|---|
elements-selector | CSS selector that would match the elements. | '.impression' |
visible-fraction | Visible fraction of elements that would trigger impression event. | 0.5 |
visible-fractioff | Visible fraction of elements that would trigger impressioff event after impression event is triggered. | 0.0 |
<script
src='https://cdn.jsdelivr.net/npm/@setyadi/impression/dist/92+/impression+off.min.js'
elements-selector='[data-track="MyImpression"]'
visible-fraction=0.8
visible-fractioff=0.1>
</script>
To run the demo, clone this repo, cd
to it, yarn install
and then pick the demo page you want to
see.
yarn demo
yarn demo:svelte
They basically demo the same thing, but you can look at the source code to see how they use
impression
.
Based on CanIUse, the above scripts should work for 92.x% or more of users worldwide. For the other times when it's not working, it doesn't break the page.
FAQs
Easy to use impression event.
We found that @nisyaban/impression demonstrated a healthy version release cadence and project activity because the last version was released less than 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.