Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
mediaevents
Advanced tools
:musical_note: Fire events for specific timeframes easily
NPM:
$ npm install mediaevents
unpkg:
<script src="https://unpkg.com/mediaevents@3.1.0/mediaevents.js"></script>
Or you can go the traditional way, grab mediaevents.js
from the repository and put it somewhere in your project with a <script>
tag!
Text:
const media = document.getElementById('audioplayer')
const text = document.getElementById('text')
// define timings and their functions
const timings = {
"0": function() {
text.innerHTML = 'New text at start'
},
"10": function() {
document.body.style.backgroundColor = 'lightblue'
text.innerHTML = 'New text and background color after 10 seconds'
}
}
// create mediaEvents instance
const ev = new mediaEvents(media, timings)
document.addEventListener('mediaEvents.ready', function(event) {
// start playback once mediaEvents is ready
ev.start()
})
new mediaEvents(audioSource, timings)
audioSource
: (required) Link to an audio file or <audio>
-Tag DOM Elementtimings
: (required) Object where the keys represent the time and the values are functions or function referencesmediaEvents.start()
This will start playback of the specified audio and execute the events at the given time. As the audio buffer is always
loaded asynchronously you should listen to the mediaEvents.ready
event on document
and execute this function once
the event was emitted.
mediaEvents is licensed under the MIT license
FAQs
Fire events for specific timeframes easily
The npm package mediaevents receives a total of 0 weekly downloads. As such, mediaevents popularity was classified as not popular.
We found that mediaevents 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.