
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
file-drop-element
Advanced tools
The file drop custom element is a simple Custom Element that accepts File
objects being
dropped on it and fires a dedicated event onfiledrop
when a successful drop occurs.
npm i file-drop-element
Copy from node_modules
in to a local directory.
<script src='file-drop.mjs' type='module'></script>
<file-drop>
Drop file here
</file-drop>
<script src='file-drop.umd.js'></script>
<file-drop>
Drop file here
</file-drop>
The element will accept any drop
event that has the .dataTransfer
object
populated with any file. If you want to control the types of files that
can be dropped on to the element, use the same syntax that <input>
elements
use when the accept
attribute is set, that is:
<file-drop>
- any file<file-drop accept='image/*'>
- all images<file-drop accept='image/png'>
- only Images that have the MIME-type of a PNG.The element an inline
display element and it can be controlled like any normal
element. The element does not use Shadow DOM so there are no internal elements
to style.
The element will add two classes drop-valid
and drop-invalid
to the element
depending on the mime-type of the file that is currently being dragged over the
element.
<style>
file-drop.drop-valid {
background-color: green;
}
file-drop.drop-invalid {
background-color: red;
}
</style>
FAQs
File Drop Custom Element
The npm package file-drop-element receives a total of 1,035 weekly downloads. As such, file-drop-element popularity was classified as popular.
We found that file-drop-element 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
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.