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.
way2web-clone
Advanced tools
Clone an element.
With this package you can clone elements on page.
Add this to your javascript file:
new Clone(element).init();
Example html:
<div class="js-clone">
<input class="js-clone-count" name="counter" type="hidden" value="1">
<form>
<div class="js-remove-target">
<button type="button" name="remove-target" class="js-clone-delete">
Delete
</button>
<input name="test[0][id]" type="hidden" value="1">
</div>
<div class="js-clone-target"></div>
</form>
<div class="is-hidden | js-remove-target js-clone-template">
<button type="button" name="remove-target" class="js-clone-delete">
Delete
</button>
<input name="test[{key}][id]" type="hidden" value="{key}">
</div>
<button class="btn btn--filled | js-add-clone-button">Add delivery address</button>
</div>
Default elements:
{
toggle: '.js-add-clone-button',
remove: '.js-clone-delete',
target: '.js-clone-target',
template: '.js-clone-template',
counter: '.js-clone-count',
removeClone: '.js-remove-target'
}
You can overrule this with: .setElements({ ... })
Default classes:
{
hidden: 'is-hidden'
}
You can overrule this with: .setClasses({ ... })
When a element is cloned or removed an event is triggered.
You can set functions to call when the element is cloned or removed.
The events are clone
and remove
.
You can overrule this with: .setEvents({ ... })
e.g.
new Clone(element)
.setEvents({
clone: testFunction
})
.init();
FAQs
Clone an element.
The npm package way2web-clone receives a total of 71 weekly downloads. As such, way2web-clone popularity was classified as not popular.
We found that way2web-clone demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers 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.